You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`<N>`**Any number**: Specifies a **minimum field width**, if the text to print is shorter, it\'s padded with spaces, if the text is longer, the field is expanded
167
+
`<N>`**Any number**: Specifies a **minimum field width**, if the text to print is shorter, it's padded with spaces, if the text is longer, the field is expanded
168
168
`.`**The dot**: Together with a field width, the field is **not** expanded when the text is longer, the text is truncated instead. \"`%.s`\" is an undocumented equivalent for \"`%.0s`\", which will force a field width of zero, effectively hiding the field from output
169
169
`*`**The asterisk**: the width is given as argument before the string or number. Usage (the \"`*`\" corresponds to the \"`20`\"): `printf "%*s\n" 20 "test string"`
170
170
`#`\"Alternative format\" for numbers: see table below
@@ -178,8 +178,8 @@ introductory `%` and the character that specifies the format:
`%#o` The octal number is printed with a leading zero, unless it\'s zero itself
182
-
`%#x`, `%#X` The hex number is printed with a leading \"`0x`\"/\"`0X`\", unless it\'s zero
181
+
`%#o` The octal number is printed with a leading zero, unless it's zero itself
182
+
`%#x`, `%#X` The hex number is printed with a leading \"`0x`\"/\"`0X`\", unless it's zero
183
183
`%#g`, `%#G` The float number is printed with **trailing zeros** until the number of digits for the current precision is reached (usually trailing zeros are not printed)
184
184
all number formats except `%d`, `%o`, `%x`, `%X` Always print a decimal point in the output, even if no digits follow it
185
185
@@ -382,7 +382,7 @@ readability.
382
382
use `%c`, you\'re actually asking for the first byte of the
383
383
argument. Likewise, the maximum field width modifier (dot) in
384
384
combination with `%s` goes by bytes, not characters. This limits
385
-
some of printf\'s functionality to working with ascii only. ksh93\'s
385
+
some of printf's functionality to working with ascii only. ksh93's
386
386
`printf` supports the `L` modifier with `%s` and `%c` (but so far
387
387
not `%S` or `%C`) in order to treat precision as character width,
388
388
not byte count. zsh appears to adjust itself dynamically based upon
@@ -409,7 +409,7 @@ fmt++;
409
409
- mksh has no built-in printf by default (usually). There is an
410
410
unsupported compile-time option to include a very poor, basically
411
411
unusable implementation. For the most part you must rely upon the
412
-
system\'s `/usr/bin/printf` or equivalent. The mksh maintainer
412
+
system's `/usr/bin/printf` or equivalent. The mksh maintainer
413
413
recommends using `print`. The development version (post- R40f) adds
414
414
a new parameter expansion in the form of `${name@Q}` which fills the
415
415
role of `printf %q`\-- expanding in a shell-escaped format.
@@ -418,7 +418,7 @@ fmt++;
418
418
<!-- -->
419
419
```
420
420
- ksh93 optimizes builtins run from within a command substitution and
421
-
which have no redirections to run in the shell\'s process. Therefore
421
+
which have no redirections to run in the shell's process. Therefore
422
422
the `printf -v` functionality can be closely matched by
423
423
`var=$(printf ...)` without a big performance hit.
424
424
@@ -447,8 +447,8 @@ fmt++;
447
447
448
448
- The optional Bash loadable `print` may be useful for ksh
0 commit comments