Files
bash/tests/heredoc.right
T
2025-07-03 16:15:36 -04:00

169 lines
2.5 KiB
Plaintext

a
b
c
a
$PS4
there
one - alpha
two - beta
three - gamma
hi\
there$a
stuff
hi\
there
EO\
F
line 1line 2
hi
hi
nextEOF
tab 1
tab 2
tab 3
abc
def ghi
jkl mno
echo "
echo \"
fff is a function
fff ()
{
ed ${TMPDIR}/foo <<ENDOFINPUT > /dev/null
/^name/d
w
q
ENDOFINPUT
aa=1
}
fff is a function
fff ()
{
ed ${TMPDIR}/foo <<ENDOFINPUT > /dev/null
/^name/d
w
q
ENDOFINPUT
aa=1
}
foo is a function
foo ()
{
echo;
cat <<END
bar
END
cat <<EOF
qux
EOF
}
bar
qux
bar
qux
abc def geh
./heredoc3.sub: line 20: warning: here-document at line 18 delimited by end-of-file (wanted `EOF')
= here is the text =
./heredoc3.sub: line 26: warning: here-document at line 24 delimited by end-of-file (wanted `EOF')
this paren ) is not a problem
./heredoc3.sub: line 32: warning: here-document at line 30 delimited by end-of-file (wanted `EOF')
these balanced parens ( ) are not a problem
./heredoc3.sub: line 38: warning: here-document at line 36 delimited by end-of-file (wanted `EOF')
quoted balanced parens \( ) are not a problem either
more text in a subshell
some more text in a different subshell
end
hello
hello
ENDEND
end ENDEND
hello
end hello
end x*x
helloEND
end helloEND
hello
\END
end hello<NL>\END
./heredoc3.sub: line 98: warning: here-document at line 96 delimited by end-of-file (wanted `EOF')
./heredoc3.sub: line 99: syntax error: unexpected end of file from `(' command on line 96
heredoc1
EOF
Ok:0
argv[1] = <onetwo>
argv[2] = <threefour>
argv[1] = <two>
argv[2] = <threefi>
argv[3] = <ve>
1: OK
2: OK
3: OK
4: OK
5: OK
6: OK
7: OK
1: OK
2: OK
3: OK
4: OK
5: OK
5: OK
1: ${x#$'no\t'}
2: O${x#$'no\t'O}
3: ${x#n$'o\t'}
4: ${x#'no '}
5: ${x#$pat}
6: ${y#$'not'}
7: ${y#'not'}
./heredoc7.sub: line 17: warning: command substitution: 1 unterminated here-document
foo bar
./heredoc7.sub: line 21: after: command not found
./heredoc7.sub: line 29: warning: here-document at line 29 delimited by end-of-file (wanted `EOF')
./heredoc7.sub: line 26: foobar: command not found
./heredoc7.sub: line 27: EOF: command not found
grep: *.c: No such file or directory
foo ()
{
echo begin;
if cat <<HERE
contents
HERE
then
echo 1 2;
echo 3 4;
fi
}
foo ()
{
echo begin;
while read var <<HERE
contents
HERE
do
echo 1 2;
echo 3 4;
done
}
hello
world
hello
world
here-doc line 1
here-doc line 2
here-document
here-document
comsub here-string
./heredoc.tests: line 184: warning: here-document at line 181 delimited by end-of-file (wanted `')
hi
there
''