Bash-5.3-alpha release

This commit is contained in:
Chet Ramey
2024-04-22 10:33:38 -04:00
parent f3b6bd1945
commit 622d318652
700 changed files with 136534 additions and 96420 deletions
+44 -3
View File
@@ -22,6 +22,13 @@ printf --
printf ""
printf -- ""
# this is an error
printf -x
# these are errors
printf -v invalid-var 'abc\n'
printf '%s\n%n' abc invalid-var
# in the future this may mean to put the output into VAR, but for
# now it is an error
# 2005-03-15 no longer an error
@@ -60,6 +67,19 @@ printf "%s%10q\n" unquoted quoted
printf "%q\n" 'this&that'
# %Q is like %q but treats the precision differently
S="a'b"
S1="${S@Q}"
T=';ls'
printf 'echo %.2q%q\n' "$S" "$T"
printf 'echo %.2Q%Q\n' "$S" "$T" # note the difference
# a different way to do it
printf 'echo %.*s%q\n' ${#S1} "$S1" "$T"
printf '%.1Q\n' '**'
printf '%.*Q\n' 1 '**'
# make sure the format string is reused to use up arguments
printf "%d " 1 2 3 4 5; printf "\n"
@@ -324,11 +344,32 @@ printf -v var "%b" @(hugo); echo "x${var}x"
# make sure that missing arguments are always handled like the empty string
printf "<%3s><%3b>\n"
# other format specifiers with missing arguments
# 0
printf '%d\n'
# null char
printf '%c\n'
printf '%x\n'
printf '%4.2f\n'
printf '%b'
printf '%q\n'
printf '%Q\n'
# let's test some out-of-range integer errors for POSIX-specified behavior
TOOBIG=9223372036854775825
TOOSMALL=-9223372036854775815
printf '%d\n' "$TOOBIG"
printf '%d\n' "$TOOSMALL"
# tests variable assignment with -v
${THIS_SH} ./printf1.sub
${THIS_SH} ./printf2.sub
${THIS_SH} ./printf3.sub
${THIS_SH} ./printf4.sub
${THIS_SH} ./printf5.sub
# multibyte characters with %ls/%S and %lc/%C
${THIS_SH} ./printf6.sub
${THIS_SH} ./printf7.sub