f0acd5581fea38e2a94b4b696dd0bb831207bcb8
[platform/upstream/bash.git] / tests / tilde-tests
1 HOME=/usr/xyz
2 SHELL=~/bash
3 echo ~ch\et
4 echo ~/"foo"
5 echo "~chet"/"foo"
6 echo \~chet/"foo"
7 echo \~chet/bar
8 echo ~\chet/bar
9 echo ~chet""/bar
10 echo ":~chet/"
11 echo abcd~chet
12 echo "SHELL=~/bash"
13 echo $SHELL
14 echo abcd:~chet
15 path=/usr/ucb:/bin:~/bin:~/tmp/bin:/usr/bin
16 echo $path
17
18 cd /usr
19 cd /tmp
20 echo ~-
21 echo ~+
22
23 XPATH=/bin:/usr/bin:.
24
25 # yes tilde expansion
26 PPATH=$XPATH:~/bin
27 echo "$PPATH"
28
29 # no tilde expansion
30 PPATH="$XPATH:~/bin"
31 echo "$PPATH"
32
33 # yes tilde expansion
34 export PPATH=$XPATH:~/bin
35 echo "$PPATH"
36
37 # no tilde expansion
38 export PPATH="$XPATH:~/bin"
39 echo "$PPATH"