blob: c50b8cedfcb164a7f39037408e77f760e906ffcc [file] [log] [blame]
Denis Vlasenkoc96865f2009-04-10 00:20:58 +00001rm *shell_test* 2>/dev/null
2
3>\shell_test
4echo *shell_test*
5rm *shell_test*
6
7>\\shell_test
8echo *shell_test*
9rm *shell_test*
10
11>"\shell_test"
12echo *shell_test*
13rm *shell_test*
14
15>"\\shell_test"
16echo *shell_test*
17rm *shell_test*
18
19
20cat <<\shell_test
21Here1
22shell_test
23echo Ok1
24
25cat <<\\shell_test
26Here2
27\shell_test
28echo Ok2
29
30cat <<"\shell_test"
31Here3
32\shell_test
33echo Ok3
34
35cat <<"\\shell_test"
36Here4
37\shell_test
38echo Ok4
39
40
Denis Vlasenko1fd1ea42009-04-10 12:03:20 +000041echo Now with variable refs
Denis Vlasenkoc96865f2009-04-10 00:20:58 +000042i=1
43
44
45>\shell_test_$i
46echo *shell_test*
47rm *shell_test*
48
49>\\shell_test_$i
50echo *shell_test*
51rm *shell_test*
52
53>"\shell_test_$i"
54echo *shell_test*
55rm *shell_test*
56
57>"\\shell_test_$i"
58echo *shell_test*
59rm *shell_test*
60
Denis Vlasenko1fd1ea42009-04-10 12:03:20 +000061echo Done;exit
62# UNFIXED BUG. bash apparently will expand $i even in terminating delimiter.
63# http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
64# does not mandate this behavior.
65# This is not likely to be used much in real-world.
Denis Vlasenkoc96865f2009-04-10 00:20:58 +000066
67cat <<\shell_test_$i
68Here1
69shell_test_$i
70echo Ok1
71
72cat <<\\shell_test_$i
73Here2
74\shell_test_$i
75echo Ok2
76
77cat <<"\shell_test_$i"
78Here3
79\shell_test_$i
80echo Ok3
81
82cat <<"\\shell_test_$i"
83Here4
84\shell_test_$i
85echo Ok4