diff options
author | Jilles Tjoelker <jilles@FreeBSD.org> | 2013-11-10 18:46:59 +0000 |
---|---|---|
committer | Jilles Tjoelker <jilles@FreeBSD.org> | 2013-11-10 18:46:59 +0000 |
commit | 309ad20076819ee6014255f437de963fdb4f5b52 (patch) | |
tree | 852e20ed3bd4899cd3c4e4d5b7f4ed01155ea03b /tools | |
parent | 868ab63514fd124ee1049e349363214e7d60dfd4 (diff) | |
download | src-309ad20076819ee6014255f437de963fdb4f5b52.tar.gz src-309ad20076819ee6014255f437de963fdb4f5b52.zip |
sh: Add a test case for would-be assignments that are not due to quoting.
Notes
Notes:
svn path=/head/; revision=257920
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 000000000000..1fd3b26f8a26 --- /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 ] |