repo.or.cz
/
bash.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Patch-ID: bash32-029
[bash.git]
/
tests
/
tilde2.tests
blob
ff6c76f0cecba49e6d4a5c5a4e6b620b465ee17b
1
HOME=/usr/xyz
2
XPATH=/bin:/usr/bin:.
3
4
ADDPATH=PATH=~/bin:$XPATH
5
6
echo $ADDPATH
7
8
unset ADDPATH
9
: ${ADDPATH:=~/bin:~/bin2:$XPATH}
10
echo $ADDPATH
11
12
unset ADDPATH
13
: ${ADDPATH:=PATH=~/bin:~/bin2:$XPATH}
14
echo $ADDPATH
15
16
cat << !
17
~/bin
18
!
19
20
echo "~"
21
22
echo ${TPATH:-~}
23
echo "${TPATH:-~}"
24
echo "${TPATH:-"~"}"
25
26
echo "${XPATH+~}"
27
28
recho "\a"
29
recho "${TPATH:-\a}"
30
31
SHELL=~/bash
32
echo $SHELL
33
34
case $SHELL in
35
~/bash) echo ok;;
36
*) echo bad;;
37
esac
38
39
somevar=
40
echo "${somevar:-~}"
41
echo "${somevar:-"~"}"
42
43
echo make -k FOO=~/mumble
44
45
typeset FOO=~/mumble
46
echo "$FOO"
47
48
h=HOME=~
49
echo $h
50
51
export h=HOME=~
52
echo $h
53
54
x=1234
55
HOME='/usr/$x/abc'
56
57
echo ~
58
59
# behavior differs here in posix mode
60
set -o posix
61
62
eval echo $h
63
eval $h
64
echo $HOME
65
66
set +o posix
67
68
eval echo $h
69
eval $h
70
echo $HOME