mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57:44 +00:00
printf.md: support %q
This commit is contained in:
parent
91a91458e7
commit
7279bc1741
1 changed files with 8 additions and 0 deletions
|
@ -78,6 +78,9 @@ Fields
|
||||||
second parameter is min-width, integer
|
second parameter is min-width, integer
|
||||||
output below that width is padded with leading zeroes
|
output below that width is padded with leading zeroes
|
||||||
|
|
||||||
|
* `%q`: ARGUMENT is printed in a format that can be reused as shell input, escaping non-printable
|
||||||
|
characters with the proposed POSIX $'' syntax.
|
||||||
|
|
||||||
* `%f` or `%F`: decimal floating point value
|
* `%f` or `%F`: decimal floating point value
|
||||||
* `%e` or `%E`: scientific notation floating point value
|
* `%e` or `%E`: scientific notation floating point value
|
||||||
* `%g` or `%G`: shorter of specially interpreted decimal or SciNote floating point value.
|
* `%g` or `%G`: shorter of specially interpreted decimal or SciNote floating point value.
|
||||||
|
@ -181,6 +184,11 @@ All string fields have a 'max width' parameter
|
||||||
still be interpreted and not throw a warning, you will have problems if you use this for a
|
still be interpreted and not throw a warning, you will have problems if you use this for a
|
||||||
literal whose code begins with zero, as it will be viewed as in `\\0NNN` form.)
|
literal whose code begins with zero, as it will be viewed as in `\\0NNN` form.)
|
||||||
|
|
||||||
|
* `%q`: escaped string - the string in a format that can be reused as input by most shells.
|
||||||
|
Non-printable characters are escaped with the POSIX proposed ‘$''’ syntax,
|
||||||
|
and shell meta-characters are quoted appropriately.
|
||||||
|
This is an equivalent format to ls --quoting=shell-escape output.
|
||||||
|
|
||||||
#### CHAR SUBSTITUTIONS
|
#### CHAR SUBSTITUTIONS
|
||||||
|
|
||||||
The character field does not have a secondary parameter.
|
The character field does not have a secondary parameter.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue