svn commit: r257920 - head/tools/regression/bin/sh/parser
Jilles Tjoelker
jilles at FreeBSD.org
Sun Nov 10 18:47:00 UTC 2013
Author: jilles
Date: Sun Nov 10 18:46:59 2013
New Revision: 257920
URL: http://svnweb.freebsd.org/changeset/base/257920
Log:
sh: Add a test case for would-be assignments that are not due to quoting.
Added:
head/tools/regression/bin/sh/parser/var-assign1.0 (contents, props changed)
Added: head/tools/regression/bin/sh/parser/var-assign1.0
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/tools/regression/bin/sh/parser/var-assign1.0 Sun Nov 10 18:46:59 2013 (r257920)
@@ -0,0 +1,19 @@
+# $FreeBSD$
+# In a variable assignment, both the name and the equals sign must be entirely
+# unquoted. Therefore, there is only one assignment below; the other words
+# containing equals signs are command words.
+
+abc=0
+\abc=1 2>/dev/null
+a\bc=2 2>/dev/null
+abc\=3 2>/dev/null
+a\bc\=4 2>/dev/null
+'abc'=5 2>/dev/null
+a'b'c=6 2>/dev/null
+abc'='7 2>/dev/null
+'abc=8' 2>/dev/null
+"abc"=9 2>/dev/null
+a"b"c=10 2>/dev/null
+abc"="11 2>/dev/null
+"abc=12" 2>/dev/null
+[ "$abc" = 0 ]
More information about the svn-src-all
mailing list