do not require leading . for rl color prefix etension; fix for isearch in single-byte locales; next set of doc updates (SIGNALS); add warning for invalid job id; allow function names to be non-identifiers in posix mode

This commit is contained in:
Chet Ramey
2024-10-26 12:39:17 -04:00
parent 474743f2da
commit ee3b91dfd9
33 changed files with 2501 additions and 2264 deletions
+7 -7
View File
@@ -76,22 +76,22 @@ swap32_posix ()
));
done
}
bash: -c: line 1: syntax error near unexpected token `done'
bash: -c: line 1: syntax error near unexpected token `done' while looking for matching `)'
bash: -c: line 1: `: $(case x in x) ;; x) done esac)'
bash: -c: line 1: syntax error near unexpected token `done'
bash: -c: line 1: syntax error near unexpected token `done' while looking for matching `)'
bash: -c: line 1: `: $(case x in x) ;; x) done ;; esac)'
bash: -c: line 1: syntax error near unexpected token `esac'
bash: -c: line 1: syntax error near unexpected token `esac' while looking for matching `)'
bash: -c: line 1: `: $(case x in x) (esac) esac)'
bash: -c: line 1: syntax error near unexpected token `in'
bash: -c: line 1: syntax error near unexpected token `in' while looking for matching `)'
bash: -c: line 1: `: $(case x in esac|in) foo;; esac)'
bash: -c: line 1: syntax error near unexpected token `done'
bash: -c: line 1: syntax error near unexpected token `done' while looking for matching `)'
bash: -c: line 1: `: $(case x in x) ;; x) done)'
case: -c: line 3: syntax error near unexpected token `esac'
case: -c: line 3: syntax error near unexpected token `esac' while looking for matching `)'
case: -c: line 3: `$( esac ; bar=foo ; echo "$bar")) echo bad 2;;'
ok 2
inside outside
ok 3
syntax-error: -c: line 2: syntax error near unexpected token `done'
syntax-error: -c: line 2: syntax error near unexpected token `done' while looking for matching `)'
syntax-error: -c: line 2: `: $(case x in x) ;; x) done ;; esac)'
yes
+3 -3
View File
@@ -68,7 +68,7 @@ umask: usage: umask [-p] [-S] [mode]
./errors.tests: line 214: VAR: readonly variable
comsub: -c: line 1: syntax error near unexpected token `)'
comsub: -c: line 1: `: $( for z in 1 2 3; do )'
comsub: -c: line 1: syntax error near unexpected token `done'
comsub: -c: line 1: syntax error near unexpected token `done' while looking for matching `)'
comsub: -c: line 1: `: $( for z in 1 2 3; done )'
./errors.tests: line 221: cd: HOME not set
./errors.tests: line 222: cd: /tmp/xyz.bash: No such file or directory
@@ -130,7 +130,7 @@ kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
./errors.tests: line 332: kill: SIGBAD: invalid signal specification
./errors.tests: line 334: kill: BAD: invalid signal specification
./errors.tests: line 336: kill: @12: arguments must be process or job IDs
./errors.tests: line 336: kill: `@12': not a pid or valid job spec
./errors.tests: line 339: unset: BASH_LINENO: cannot unset
./errors.tests: line 339: unset: BASH_SOURCE: cannot unset
./errors.tests: line 342: set: trackall: invalid option name
@@ -343,4 +343,4 @@ sh: line 1: unset: `a-b': not a valid identifier
sh: line 1: /nosuchfile: No such file or directory
sh: line 1: trap: SIGNOSIG: invalid signal specification
after trap
./errors.tests: line 396: `!!': not a valid identifier
end
+2 -4
View File
@@ -388,10 +388,8 @@ ${THIS_SH} -o posix -c '. /nosuchfile ; echo after source' sh
# but trap specifying a bad signal nunber is non-fatal
${THIS_SH} -o posix -c 'trap "echo bad" SIGNOSIG; echo after trap' sh
# this must be last!
# in posix mode, a function name must be a valid identifier
# this can't go in posix2.tests, since it causes the shell to exit
# immediately
# in posix mode, this is no longer a fatal error
# a function name does not have to be a valid identifier
set -o posix
function !! () { fc -s "$@" ; }
set +o posix
+2 -3
View File
@@ -175,7 +175,7 @@ function a=2 ()
{
printf "FUNCNAME: %s\n" $FUNCNAME
}
function 11111 ()
11111 ()
{
printf "FUNCNAME: %s\n" $FUNCNAME
}
@@ -242,14 +242,13 @@ break ()
execution
inside function break
./func5.sub: line 86: `break': is a special builtin
./func5.sub: line 92: `!!': not a valid identifier
!! is a function
!! ()
{
fc -s "$@"
}
!! is a function
function !! ()
!! ()
{
fc -s "$@"
}
+4 -4
View File
@@ -85,15 +85,15 @@ break()
echo after
)
# in posix mode, functions whose names are invalid identifiers are fatal errors
# in posix mode, functions whose names are invalid identifiers are
# no longer fatal errors
( set -o posix
!! () { fc -s "$@" ; }
type \!\!
)
# but you can create such functions and print them in posix mode
# you can create such functions and print them in posix mode
set -o posix
!! () { fc -s "$@" ; }
type '!!'
set -o posix
type '!!'
set +o posix
+1
View File
@@ -79,6 +79,7 @@ bg: usage: bg [job_spec ...]
disown: usage: disown [-h] [-ar] [jobspec ... | pid ...]
./jobs.tests: line 141: disown: %1: no such job
./jobs.tests: line 144: disown: %2: no such job
./jobs.tests: line 147: disown: warning: @12: job specification requires leading `%'
./jobs.tests: line 147: disown: @12: no such job
wait-for-non-child
./jobs.tests: line 150: wait: pid 1 is not a child of this shell