a select command invalid selection variable name is now a fatal error in posix mode; many test suite additions

This commit is contained in:
Chet Ramey
2023-09-25 15:08:04 -04:00
parent 1cc5a8f752
commit b3958b3ab4
56 changed files with 903 additions and 147 deletions
+17
View File
@@ -34,6 +34,21 @@ unalias hoowah
# the iteration variable must be a valid identifier
for 1 in a b c; do echo $1; done
for f\1 in a b c ; do echo $f ; done
# in posix mode, it's a fatal error
(set -o posix
for invalid-name in a b c; do echo $1; done; echo after posix for)
(set -o posix
for f\1 in a b c ; do echo $f ; done; echo after posix for 2)
# same with select
select 1 in a b c; do echo $REPLY; done
select f\1 in a b c ; do echo $REPLY ; done
select invalid-name in a b c; do echo $REPLY; done
(set -o posix ; select 1 in a b c; do echo $REPLY; done; echo after posix select)
(set -o posix ; select f\1 in a b c ; do echo $REPLY ; done ; echo after posix select 2)
# try to rebind a read-only function
func()
@@ -271,6 +286,8 @@ kill -INT
# bad shell option names
set -o trackall # bash is not ksh
set -q # this is an error
set -i # this is not allowed
# problem with versions through bash-4.2
readonly xx=5