Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Nov 2013 18:46:59 +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: r257920 - head/tools/regression/bin/sh/parser
Message-ID:  <201311101846.rAAIkxJh089601@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 ]



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