Denis Vlasenko | c96865f | 2009-04-10 00:20:58 +0000 | [diff] [blame] | 1 | rm *shell_test* 2>/dev/null |
| 2 | |
| 3 | >\shell_test |
| 4 | echo *shell_test* |
| 5 | rm *shell_test* |
| 6 | |
| 7 | >\\shell_test |
| 8 | echo *shell_test* |
| 9 | rm *shell_test* |
| 10 | |
| 11 | >"\shell_test" |
| 12 | echo *shell_test* |
| 13 | rm *shell_test* |
| 14 | |
| 15 | >"\\shell_test" |
| 16 | echo *shell_test* |
| 17 | rm *shell_test* |
| 18 | |
| 19 | |
| 20 | cat <<\shell_test |
| 21 | Here1 |
| 22 | shell_test |
| 23 | echo Ok1 |
| 24 | |
| 25 | cat <<\\shell_test |
| 26 | Here2 |
| 27 | \shell_test |
| 28 | echo Ok2 |
| 29 | |
| 30 | cat <<"\shell_test" |
| 31 | Here3 |
| 32 | \shell_test |
| 33 | echo Ok3 |
| 34 | |
| 35 | cat <<"\\shell_test" |
| 36 | Here4 |
| 37 | \shell_test |
| 38 | echo Ok4 |
| 39 | |
| 40 | |
Denis Vlasenko | 1fd1ea4 | 2009-04-10 12:03:20 +0000 | [diff] [blame] | 41 | echo Now with variable refs |
Denis Vlasenko | c96865f | 2009-04-10 00:20:58 +0000 | [diff] [blame] | 42 | i=1 |
| 43 | |
| 44 | |
| 45 | >\shell_test_$i |
| 46 | echo *shell_test* |
| 47 | rm *shell_test* |
| 48 | |
| 49 | >\\shell_test_$i |
| 50 | echo *shell_test* |
| 51 | rm *shell_test* |
| 52 | |
| 53 | >"\shell_test_$i" |
| 54 | echo *shell_test* |
| 55 | rm *shell_test* |
| 56 | |
| 57 | >"\\shell_test_$i" |
| 58 | echo *shell_test* |
| 59 | rm *shell_test* |
| 60 | |
Denis Vlasenko | 1fd1ea4 | 2009-04-10 12:03:20 +0000 | [diff] [blame] | 61 | echo 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 Vlasenko | c96865f | 2009-04-10 00:20:58 +0000 | [diff] [blame] | 66 | |
| 67 | cat <<\shell_test_$i |
| 68 | Here1 |
| 69 | shell_test_$i |
| 70 | echo Ok1 |
| 71 | |
| 72 | cat <<\\shell_test_$i |
| 73 | Here2 |
| 74 | \shell_test_$i |
| 75 | echo Ok2 |
| 76 | |
| 77 | cat <<"\shell_test_$i" |
| 78 | Here3 |
| 79 | \shell_test_$i |
| 80 | echo Ok3 |
| 81 | |
| 82 | cat <<"\\shell_test_$i" |
| 83 | Here4 |
| 84 | \shell_test_$i |
| 85 | echo Ok4 |