1 |
#### _this_dir in main and oshrc |
2 |
|
3 |
$SH $REPO_ROOT/spec/testdata/module/this_dir.oil |
4 |
|
5 |
echo interactive |
6 |
|
7 |
$SH -i --rcfile $REPO_ROOT/spec/testdata/module/this_dir.oil -c 'echo -c' |
8 |
|
9 |
## STDOUT: |
10 |
hi from this_dir.oil |
11 |
$_this_dir = REPLACED/oil/spec/testdata/module |
12 |
interactive |
13 |
hi from this_dir.oil |
14 |
$_this_dir = REPLACED/oil/spec/testdata/module |
15 |
-c |
16 |
## END |
17 |
|
18 |
#### _this_dir not set on stdin |
19 |
|
20 |
echo ${_this_dir:-'not yet'} |
21 |
## STDOUT: |
22 |
not yet |
23 |
## END |
24 |
|
25 |
|
26 |
#### _this_dir in sourced module |
27 |
source $REPO_ROOT/spec/testdata/module/this_dir.oil |
28 |
## STDOUT: |
29 |
hi from this_dir.oil |
30 |
$_this_dir = REPLACED/oil/spec/testdata/module |
31 |
## END |
32 |
|
33 |
|
34 |
#### _this_dir not affected by 'cd' |
35 |
cd /tmp |
36 |
source $REPO_ROOT/spec/testdata/module/this_dir.oil |
37 |
## STDOUT: |
38 |
hi from this_dir.oil |
39 |
$_this_dir = REPLACED/oil/spec/testdata/module |
40 |
## END |
41 |
|
42 |
#### _this_dir used with relative path |
43 |
cd $REPO_ROOT |
44 |
source spec/testdata/module/this_dir.oil |
45 |
## STDOUT: |
46 |
hi from this_dir.oil |
47 |
$_this_dir = REPLACED/oil/spec/testdata/module |
48 |
## END |