Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Jun 2011 12:46:26 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r222715 - head/tools/regression/bin/sh/expansion
Message-ID:  <201106051246.p55CkQ2U060817@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Sun Jun  5 12:46:26 2011
New Revision: 222715
URL: http://svn.freebsd.org/changeset/base/222715

Log:
  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

Added:
  head/tools/regression/bin/sh/expansion/heredoc1.0   (contents, props changed)

Added: head/tools/regression/bin/sh/expansion/heredoc1.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/heredoc1.0	Sun Jun  5 12:46:26 2011	(r222715)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106051246.p55CkQ2U060817>