svn commit: r238430 - head/tools/regression/bin/sh/expansion

Jilles Tjoelker jilles at FreeBSD.org
Fri Jul 13 22:29:02 UTC 2012


Author: jilles
Date: Fri Jul 13 22:29:02 2012
New Revision: 238430
URL: http://svn.freebsd.org/changeset/base/238430

Log:
  sh: Add tests where "export" does not parse differently.
  
  It is planned to expand variable assignments as assignments (no word
  splitting, different tilde expansion) when they follow a "declaration
  utility" (export, readonly or local). However, a quoted character cannot be
  part of a "name" so things like \v=~ are not assignments, and the existing
  behaviour applies.

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

Added: head/tools/regression/bin/sh/expansion/export1.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/export1.0	Fri Jul 13 22:29:02 2012	(r238430)
@@ -0,0 +1,13 @@
+# $FreeBSD$
+
+w='@ vv=6'
+
+v=0 vv=0
+export \v=$w
+[ "$v" = "@" ] || echo "Expected @ got $v"
+[ "$vv" = "6" ] || echo "Expected 6 got $vv"
+
+HOME=/known/value
+
+export \v=~
+[ "$v" = \~ ] || echo "Expected ~ got $v"


More information about the svn-src-all mailing list