diff options
author | jilles <jilles@FreeBSD.org> | 2013-11-10 18:46:59 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2013-11-10 18:46:59 +0000 |
commit | 5ce52e7e3e564e58d0b66b8e7cecf98e830b9e01 (patch) | |
tree | 852e20ed3bd4899cd3c4e4d5b7f4ed01155ea03b /tools | |
parent | d6353d6a83b75bdb4b22bb28463ec921cf7635c3 (diff) | |
download | FreeBSD-src-5ce52e7e3e564e58d0b66b8e7cecf98e830b9e01.zip FreeBSD-src-5ce52e7e3e564e58d0b66b8e7cecf98e830b9e01.tar.gz |
sh: Add a test case for would-be assignments that are not due to quoting.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/bin/sh/parser/var-assign1.0 | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/parser/var-assign1.0 b/tools/regression/bin/sh/parser/var-assign1.0 new file mode 100644 index 0000000..1fd3b26 --- /dev/null +++ b/tools/regression/bin/sh/parser/var-assign1.0 @@ -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 ] |