2009-04-10 00:20:58 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2009-04-10 12:03:20 +00:00
|
|
|
echo Now with variable refs
|
2009-04-10 00:20:58 +00:00
|
|
|
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*
|
|
|
|
|
2009-04-10 12:03:20 +00:00
|
|
|
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.
|
2009-04-10 00:20:58 +00:00
|
|
|
|
|
|
|
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
|