]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20180329 snapshot
authorChet Ramey <chet.ramey@case.edu>
Mon, 2 Apr 2018 14:00:50 +0000 (10:00 -0400)
committerChet Ramey <chet.ramey@case.edu>
Mon, 2 Apr 2018 14:00:50 +0000 (10:00 -0400)
MANIFEST
doc/bashref.texi
tests/parser.right
tests/parser.tests
tests/posix2syntax.sub [new file with mode: 0644]
tests/procsub.right
tests/procsub.tests
tests/procsub1.sub [new file with mode: 0644]
tests/redir.right
tests/redir.tests
tests/redir12.sub

index a92e558c029e00947b368deb27e68a558f621bfc..235bd9e4177ace05c3c383b00b94d3c7799d89e4 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1164,6 +1164,7 @@ tests/parser.right        f
 tests/parser1.sub      f
 tests/posix2.tests     f
 tests/posix2.right     f
+tests/posix2syntax.sub f
 tests/posixexp.tests   f
 tests/posixexp.right   f
 tests/posixexp1.sub    f
@@ -1188,6 +1189,7 @@ tests/printf3.sub f
 tests/printf4.sub      f
 tests/procsub.tests    f
 tests/procsub.right    f
+tests/procsub1.sub     f
 tests/quote.tests      f
 tests/quote.right      f
 tests/quote1.sub       f
@@ -1215,7 +1217,6 @@ tests/redir8.sub  f
 tests/redir9.sub       f
 tests/redir10.sub      f
 tests/redir11.sub      f
-tests/redir12.sub      f
 tests/rhs-exp.tests    f
 tests/rhs-exp.right    f
 tests/rhs-exp1.sub     f
index fa39b7518f92c52ee94d3c41ce7def449f14ecff..ddc49b4030025fbf099f6acfdd6d133d50b5638d 100644 (file)
@@ -6712,7 +6712,7 @@ In the absence of any traps, Bash ignores @code{SIGTERM}
 
 @item
 In the absence of any traps, @code{SIGINT} is caught and handled
-((@pxref{Signals}).
+(@pxref{Signals}).
 @code{SIGINT} will interrupt some shell builtins.
 
 @item
index 43d5a8ed6ef6c00ff775008633f95787d088285d..cecbb2223c23f4f410f5b77dcefbcfaacfdc9303 100644 (file)
@@ -1 +1,16 @@
 AAA
+bash5: `invalid-name': not a valid identifier
+in
+in
+in
+in
+bash5: -c: line 0: syntax error near unexpected token `)'
+bash5: -c: line 0: `case x in esac) echo done; esac'
+in
+bash5: -c: line 0: syntax error near unexpected token `do'
+bash5: -c: line 0: `case in do do) echo in; esac'
+bash5: -c: line 0: syntax error near unexpected token `('
+bash5: -c: line 0: `for()'
+in
+done
+ok 1
index 12ff88c2998e7e279bffd1b4e215b28635f88e8e..6e020a4ba64236829090a8f5714d2306fc471462 100644 (file)
@@ -2,3 +2,5 @@
 
 # this has to be in a separate file to get desired EOF behavior
 ${THIS_SH} ./parser1.sub
+
+${THIS_SH} ./posix2syntax.sub
diff --git a/tests/posix2syntax.sub b/tests/posix2syntax.sub
new file mode 100644 (file)
index 0000000..e7dda58
--- /dev/null
@@ -0,0 +1,53 @@
+: ${THIS_SH:=./bash}
+bashname=bash${BASH_VERSION%%.*}
+
+# tests for Posix grammar special cases
+
+# Posix grammar rule 5
+${THIS_SH} -c 'for invalid-name in a b c; do echo error; done' $bashname
+
+# Posix grammar rule 6: third word in FOR or SELECT
+for i; do echo; done; echo in
+for i; do echo in; done
+for i do echo in; done
+
+select i; do echo; done; echo in
+select i; do echo in; done; echo in
+select i do echo in; done; echo in
+
+# Posix grammar rule 4: when PATTERN == ESAC, return ESAC
+${THIS_SH} -c 'case x in esac) echo done; esac' $bashname
+
+# Posix grammar rule 6: third word in CASE
+${THIS_SH} -c 'case in in in) echo in; esac;' $bashname
+${THIS_SH} -c 'case in do do) echo in; esac' $bashname
+
+# Posix grammar rule 8: function NAME
+${THIS_SH} -o posix -c 'for()
+{
+echo function for;
+}' $bashname
+
+for for in for; do echo in; echo done; done
+
+${THIS_SH} -c 'for (( i = 0; i < 5; i++ )) do : ; done' $bashname
+${THIS_SH} -c 'for (( i = 0; i < 5; i++ )) { : ; }' $bashname
+
+# bug report: IN turning on unwanted alias expansion
+${THIS_SH} -o posix -c '
+alias foo='two words'
+foo_word='foo'
+case "$foo_word"
+in
+       foo) echo "bad 1";;
+esac' $bashname
+
+${THIS_SH} -o posix -c '
+alias foo='oneword'
+foo_word='foo'
+case "$foo_word"
+in
+       foo) echo "ok 1";;
+esac' $bashname
+
+
index 5167c97e4b206ca833fc5a4e5b2d08801d7907b8..0d10aba404f40be906b27fd5ffcb077f78817316 100644 (file)
@@ -26,3 +26,4 @@ extern
        0
        0
        0
+123
index 2b60e239d3e76fe736309766a3b0c1488afb40f2..cbd74b0034337e7cacdf923b670a6e45bb899027 100644 (file)
@@ -91,3 +91,5 @@ EOF
 
 ${THIS_SH} -c "source $FN <(date)"
 rm -f $FN
+
+${THIS_SH} ./procsub1.sub
diff --git a/tests/procsub1.sub b/tests/procsub1.sub
new file mode 100644 (file)
index 0000000..0e68f3b
--- /dev/null
@@ -0,0 +1,5 @@
+# make sure we can wait for the last process substitution, since it sets $!
+cat <(exit 123) >/dev/null
+
+wait "$!"
+echo $?
index a9ad75323f22f3991b7c585fb6a5763d18a9de8d..ab737d494e6122f752e32f4f20bbf79e84ccc0ca 100644 (file)
@@ -157,4 +157,3 @@ a+=3
 foo
 foo
 ./redir11.sub: line 53: $(echo $a): Bad file descriptor
-123
index 24e3cd1a55f870b4f6d492bf5bee48733f0e2743..7b74ac53def7705ac83b5c20ab6f5bde5a28a98e 100644 (file)
@@ -191,4 +191,3 @@ ${THIS_SH} ./redir9.sub
 ${THIS_SH} ./redir10.sub
 
 ${THIS_SH} ./redir11.sub
-${THIS_SH} ./redir12.sub
index 0e68f3b23dabf1396cd49f799fb43d94b20b00f7..66376235a8fa8ec9a41c5b58431371cc7dfafad5 100644 (file)
@@ -1,5 +1,5 @@
-# make sure we can wait for the last process substitution, since it sets $!
-cat <(exit 123) >/dev/null
-
-wait "$!"
-echo $?
+umask 0777
+cat <<'  HERE'
+look ma, no permissions
+HERE
+cat <<<"it's a miracle"