Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

sh: Add testcase for $? in here-document.

Obtained-from:  FreeBSD 222715
  • Loading branch information...
commit 7975815b04775132a30684282b0f33191f0399c4 1 parent 406adc9
Peter Avalos authored
Showing with 25 additions and 0 deletions.
  1. +25 −0 tools/regression/bin/sh/expansion/heredoc1.0
View
25 tools/regression/bin/sh/expansion/heredoc1.0
@@ -0,0 +1,25 @@
+# $FreeBSD: src/tools/regression/bin/sh/expansion/heredoc1.0,v 1.1 2011/06/05 12:46:26 jilles Exp $
+
+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
Please sign in to comment.
Something went wrong with that request. Please try again.