summaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-redir/redir4.tests
blob: c50b8cedfcb164a7f39037408e77f760e906ffcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
rm *shell_test* 2>/dev/null

>\shell_test
echo *shell_test*
rm *shell_test*

>\\shell_test
echo *shell_test*
rm *shell_test*

>"\shell_test"
echo *shell_test*
rm *shell_test*

>"\\shell_test"
echo *shell_test*
rm *shell_test*


cat <<\shell_test
Here1
shell_test
echo Ok1

cat <<\\shell_test
Here2
\shell_test
echo Ok2

cat <<"\shell_test"
Here3
\shell_test
echo Ok3

cat <<"\\shell_test"
Here4
\shell_test
echo Ok4


echo Now with variable refs
i=1


>\shell_test_$i
echo *shell_test*
rm *shell_test*

>\\shell_test_$i
echo *shell_test*
rm *shell_test*

>"\shell_test_$i"
echo *shell_test*
rm *shell_test*

>"\\shell_test_$i"
echo *shell_test*
rm *shell_test*

echo Done;exit
# UNFIXED BUG. bash apparently will expand $i even in terminating delimiter.
# http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
# does not mandate this behavior.
# This is not likely to be used much in real-world.

cat <<\shell_test_$i
Here1
shell_test_$i
echo Ok1

cat <<\\shell_test_$i
Here2
\shell_test_$i
echo Ok2

cat <<"\shell_test_$i"
Here3
\shell_test_$i
echo Ok3

cat <<"\\shell_test_$i"
Here4
\shell_test_$i
echo Ok4