]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/nquote.tests
Imported from ../bash-2.04.tar.gz.
[thirdparty/bash.git] / tests / nquote.tests
CommitLineData
ccc6cda3
JA
1expect()
2{
3 echo expect "$@"
4}
5
6expect '<^J^J^J>'
7recho $'\n\n\n'
8
bb70624e
JA
9expect '<++^J++>'
10f=$'\n'
11recho "++$f++"
12unset f
13
ccc6cda3
JA
14z1=$''
15expect '<>'
16recho "$z1"
17
18ZIFS=$'\n'$'\t'$' '
19
20expect '<^J^I >'
21recho "$ZIFS"
22
23expect '<abc>'
24recho $'abc'
25
26expect '<^M^[^Gabc>'
27recho $'\r\e\aabc'
28
29D=$"hello"," "$"world"
30
31expect '<hello,> <world>'
32recho $D
33
34expect '<hello, world>'
35recho "$D"
36
37D=$""
38expect '<>'
39recho "$D"
40
41world=chet
42
43expect '<$hello, world>'
44recho \$"hello, world"
45
46expect '<hello, $world>'
47recho $"hello, \$world"
48
49expect '<hello, "world">'
50recho $"hello, \"world\""
51
52expect '<hello, $"world">'
53recho $"hello"', $"world"'
54
55expect '<hello, $"world">'
56recho $'hello, $"world"'
57
58expect '<$hello, chet>'
59recho \$"hello, $world"
60
61expect '<hello, chet>'
62recho $"hello, $world"
d166f048
JA
63
64z=$'\v\f\a\b'
65case "$z" in
66$'\v\f\a\b') echo ok;;
67*) echo bad;;
68esac
bb70624e
JA
69
70# Dave Korn says this should be allowed and echo 'abcd'
71echo $'\'abcd\''
72
73# printf translates \' to ' ...
74printf "\'abcd\'\n"
75
76# but echo -e doesn't
77echo -e "\'abcd\'"
78echo -e "\\'abcd\\'"
79
80