mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-07 20:30:52 +02:00
Imported from ../bash-2.04.tar.gz.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
LC_ALL=C
|
||||
LC_NUMERIC=C
|
||||
|
||||
# these should output error messages -- the format is required
|
||||
printf
|
||||
@@ -22,6 +23,11 @@ printf "no newline " ; printf "now newline\n"
|
||||
# %% -> %
|
||||
printf "%%\n"
|
||||
|
||||
# this was a bug caused by pre-processing the string for backslash escapes
|
||||
# before doing the `%' format processing -- all versions before bash-2.04
|
||||
printf "\045" ; echo
|
||||
printf "\045d\n"
|
||||
|
||||
# simple character output
|
||||
printf "%c\n" ABCD
|
||||
|
||||
@@ -83,6 +89,12 @@ printf -- "--%b--\n"
|
||||
# of the format string
|
||||
printf -- "--%b--\n" '4.2\c5.4\n'; printf "\n"
|
||||
|
||||
# unrecognized escape sequences should by displayed unchanged
|
||||
printf -- "--%b--\n" '4\.2'
|
||||
|
||||
# a bare \ should not be processed as an escape sequence
|
||||
printf -- "--%b--\n" '\'
|
||||
|
||||
# make sure extra arguments are ignored if the format string doesn't
|
||||
# actually use them
|
||||
printf "\n" 4.4 BSD
|
||||
@@ -158,6 +170,23 @@ printf -- "--%6.4b--\n" abcdefghijklmnopqrstuvwxyz
|
||||
printf -- "--%12.10s--\n" abcdefghijklmnopqrstuvwxyz
|
||||
printf -- "--%12.10b--\n" abcdefghijklmnopqrstuvwxyz
|
||||
|
||||
# tests for translating \' to ' and \\ to \
|
||||
# printf translates \' to ' in the format string...
|
||||
printf "\'abcd\'\n"
|
||||
|
||||
# but not when the %b format specification is used
|
||||
printf "%b\n" \\\'abcd\\\'
|
||||
|
||||
# but both translate \\ to \
|
||||
printf '\\abcd\\\n'
|
||||
printf "%b\n" '\\abcd\\'
|
||||
|
||||
# this was reported as a bug in bash-2.03
|
||||
# these three lines should all echo `26'
|
||||
printf "%d\n" 0x1a
|
||||
printf "%d\n" 032
|
||||
printf "%d\n" 26
|
||||
|
||||
# error messages
|
||||
|
||||
# this should be an overflow, but error messages vary between systems
|
||||
|
||||
Reference in New Issue
Block a user