]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/tilde2.tests
bash-5.1 distribution sources and documentation
[thirdparty/bash.git] / tests / tilde2.tests
CommitLineData
8868edaf
CR
1# This program is free software: you can redistribute it and/or modify
2# it under the terms of the GNU General Public License as published by
3# the Free Software Foundation, either version 3 of the License, or
4# (at your option) any later version.
5#
6# This program is distributed in the hope that it will be useful,
7# but WITHOUT ANY WARRANTY; without even the implied warranty of
8# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9# GNU General Public License for more details.
10#
11# You should have received a copy of the GNU General Public License
12# along with this program. If not, see <http://www.gnu.org/licenses/>.
13#
95732b49
JA
14HOME=/usr/xyz
15XPATH=/bin:/usr/bin:.
16
17ADDPATH=PATH=~/bin:$XPATH
18
19echo $ADDPATH
20
21unset ADDPATH
22: ${ADDPATH:=~/bin:~/bin2:$XPATH}
23echo $ADDPATH
24
25unset ADDPATH
26: ${ADDPATH:=PATH=~/bin:~/bin2:$XPATH}
27echo $ADDPATH
28
29cat << !
30~/bin
31!
32
33echo "~"
34
35echo ${TPATH:-~}
36echo "${TPATH:-~}"
37echo "${TPATH:-"~"}"
38
39echo "${XPATH+~}"
40
41recho "\a"
42recho "${TPATH:-\a}"
43
44SHELL=~/bash
45echo $SHELL
46
47case $SHELL in
48~/bash) echo ok;;
49*) echo bad;;
50esac
51
52somevar=
53echo "${somevar:-~}"
54echo "${somevar:-"~"}"
55
56echo make -k FOO=~/mumble
57
58typeset FOO=~/mumble
59echo "$FOO"
60
61h=HOME=~
62echo $h
63
64export h=HOME=~
65echo $h
66
67x=1234
68HOME='/usr/$x/abc'
69
70echo ~
71
72# behavior differs here in posix mode
73set -o posix
74
75eval echo $h
76eval $h
77echo $HOME
78
79set +o posix
80
81eval echo $h
82eval $h
83echo $HOME