4 # test out the new $(< filename) code
5 # it should be exactly equivalent to $(cat filename)
7 FILENAME=/tmp/bashtmp.x$$
9 trap 'rm -f $FILENAME' 0
17 LINES1=$(cat $FILENAME)
20 if [[ $LINES1 != $LINES2 ]]; then
21 echo 'whoops: $(< filename) failed'
24 LINES2=$(< /tmp/bashtmp.x*)
25 if [[ $LINES1 != $LINES2 ]]; then
26 echo 'whoops: $(< filename) with glob expansion failed'
29 # but the glob expansion in the redirection should fail in posix mode
31 LINES2=$(< /tmp/bashtmp.x*)
34 # now see what happens when we try it with a non-existant file
35 LINES3=$(< /tmp/redir-notthere)