Patch-ID: bash32-029
[bash.git] / tests / tilde2.tests
blobff6c76f0cecba49e6d4a5c5a4e6b620b465ee17b
1 HOME=/usr/xyz
2 XPATH=/bin:/usr/bin:.
4 ADDPATH=PATH=~/bin:$XPATH
6 echo $ADDPATH
8 unset ADDPATH
9 : ${ADDPATH:=~/bin:~/bin2:$XPATH}
10 echo $ADDPATH
12 unset ADDPATH
13 : ${ADDPATH:=PATH=~/bin:~/bin2:$XPATH}
14 echo $ADDPATH
16 cat << !
17 ~/bin
20 echo "~"
22 echo ${TPATH:-~}
23 echo "${TPATH:-~}"
24 echo "${TPATH:-"~"}"
26 echo "${XPATH+~}"
28 recho "\a"
29 recho "${TPATH:-\a}"
31 SHELL=~/bash
32 echo $SHELL
34 case $SHELL in
35 ~/bash) echo ok;;
36 *)      echo bad;;
37 esac
39 somevar=
40 echo "${somevar:-~}"
41 echo "${somevar:-"~"}"
43 echo make -k FOO=~/mumble
45 typeset FOO=~/mumble
46 echo "$FOO"
48 h=HOME=~
49 echo $h
51 export h=HOME=~
52 echo $h
54 x=1234
55 HOME='/usr/$x/abc'
57 echo ~
59 # behavior differs here in posix mode
60 set -o posix
62 eval echo $h
63 eval $h
64 echo $HOME
66 set +o posix
68 eval echo $h
69 eval $h
70 echo $HOME