sh: Add already working testcases for $? in here-document.
If the here-document is attached to a compound command or subshell, $? already works properly. This is both a workaround for bin/41410 and a requirement for a true fix for bin/41410. PR: bin/41410 MFC after: 1 week
This commit is contained in:
parent
7de7a90404
commit
b17788c1a9
25
tools/regression/bin/sh/expansion/heredoc1.0
Normal file
25
tools/regression/bin/sh/expansion/heredoc1.0
Normal file
@ -0,0 +1,25 @@
|
||||
# $FreeBSD$
|
||||
|
||||
f() { return $1; }
|
||||
|
||||
[ `f 42; { cat; } <<EOF
|
||||
$?
|
||||
EOF
|
||||
` = 42 ] || echo compound command bad
|
||||
|
||||
[ `f 42; (cat) <<EOF
|
||||
$?
|
||||
EOF
|
||||
` = 42 ] || echo subshell bad
|
||||
|
||||
long=`printf %08192d 0`
|
||||
|
||||
[ `f 42; { cat; } <<EOF
|
||||
$long.$?
|
||||
EOF
|
||||
` = $long.42 ] || echo long compound command bad
|
||||
|
||||
[ `f 42; (cat) <<EOF
|
||||
$long.$?
|
||||
EOF
|
||||
` = $long.42 ] || echo long subshell bad
|
Loading…
x
Reference in New Issue
Block a user