mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-02 14:01:20 -03:00
Switch backticks to double backticks for rst compatibility
This commit is contained in:
@@ -11,54 +11,54 @@ Description
|
||||
------------
|
||||
printf formats the string FORMAT with ARGUMENT, and displays the result.
|
||||
|
||||
The string FORMAT should contain format specifiers, each of which are replaced with successive arguments according to the specifier. Specifiers are detailed below, and are taken from the C library function `printf(3)`.
|
||||
The string FORMAT should contain format specifiers, each of which are replaced with successive arguments according to the specifier. Specifiers are detailed below, and are taken from the C library function ``printf(3)``.
|
||||
|
||||
Unlike `echo`, `printf` does not append a new line unless it is specified as part of the string.
|
||||
Unlike ``echo``, ``printf`` does not append a new line unless it is specified as part of the string.
|
||||
|
||||
Valid format specifiers are:
|
||||
|
||||
- `%%d`: Argument will be used as decimal integer (signed or unsigned)
|
||||
- ``%%d``: Argument will be used as decimal integer (signed or unsigned)
|
||||
|
||||
- `%%i`: Argument will be used as a signed integer
|
||||
- ``%%i``: Argument will be used as a signed integer
|
||||
|
||||
- `%%o`: An octal unsigned integer
|
||||
- ``%%o``: An octal unsigned integer
|
||||
|
||||
- `%%u`: An unsigned decimal integer
|
||||
- ``%%u``: An unsigned decimal integer
|
||||
|
||||
- `%%x` or `%%X`: An unsigned hexadecimal integer
|
||||
- ``%%x`` or ``%%X``: An unsigned hexadecimal integer
|
||||
|
||||
- `%%f`, `%%g` or `%%G`: A floating-point number
|
||||
- ``%%f``, ``%%g`` or ``%%G``: A floating-point number
|
||||
|
||||
- `%%e` or `%%E`: A floating-point number in scientific (XXXeYY) notation
|
||||
- ``%%e`` or ``%%E``: A floating-point number in scientific (XXXeYY) notation
|
||||
|
||||
- `%%s`: A string
|
||||
- ``%%s``: A string
|
||||
|
||||
- `%%b`: As a string, interpreting backslash escapes, except that octal escapes are of the form \0 or \0ooo.
|
||||
- ``%%b``: As a string, interpreting backslash escapes, except that octal escapes are of the form \0 or \0ooo.
|
||||
|
||||
`%%` signifies a literal "%".
|
||||
``%%`` signifies a literal "%".
|
||||
|
||||
Note that conversion may fail, e.g. "102.234" will not losslessly convert to an integer, causing printf to print an error.
|
||||
|
||||
printf also knows a number of backslash escapes:
|
||||
- `\"` double quote
|
||||
- `\\` backslash
|
||||
- `\a` alert (bell)
|
||||
- `\b` backspace
|
||||
- `\c` produce no further output
|
||||
- `\e` escape
|
||||
- `\f` form feed
|
||||
- `\n` new line
|
||||
- `\r` carriage return
|
||||
- `\t` horizontal tab
|
||||
- `\v` vertical tab
|
||||
- `\ooo` octal number (ooo is 1 to 3 digits)
|
||||
- `\xhh` hexadecimal number (hhh is 1 to 2 digits)
|
||||
- `\uhhhh` 16-bit Unicode character (hhhh is 4 digits)
|
||||
- `\Uhhhhhhhh` 32-bit Unicode character (hhhhhhhh is 8 digits)
|
||||
- ``\"`` double quote
|
||||
- ``\\`` backslash
|
||||
- ``\a`` alert (bell)
|
||||
- ``\b`` backspace
|
||||
- ``\c`` produce no further output
|
||||
- ``\e`` escape
|
||||
- ``\f`` form feed
|
||||
- ``\n`` new line
|
||||
- ``\r`` carriage return
|
||||
- ``\t`` horizontal tab
|
||||
- ``\v`` vertical tab
|
||||
- ``\ooo`` octal number (ooo is 1 to 3 digits)
|
||||
- ``\xhh`` hexadecimal number (hhh is 1 to 2 digits)
|
||||
- ``\uhhhh`` 16-bit Unicode character (hhhh is 4 digits)
|
||||
- ``\Uhhhhhhhh`` 32-bit Unicode character (hhhhhhhh is 8 digits)
|
||||
|
||||
The `format` argument is re-used as many times as necessary to convert all of the given arguments. If a format specifier is not appropriate for the given argument, an error is printed. For example, `printf '%d' "102.234"` produces an error, as "102.234" cannot be formatted as an integer.
|
||||
The ``format`` argument is re-used as many times as necessary to convert all of the given arguments. If a format specifier is not appropriate for the given argument, an error is printed. For example, ``printf '%d' "102.234"`` produces an error, as "102.234" cannot be formatted as an integer.
|
||||
|
||||
This file has been imported from the printf in GNU Coreutils version 6.9. If you would like to use a newer version of printf, for example the one shipped with your OS, try `command printf`.
|
||||
This file has been imported from the printf in GNU Coreutils version 6.9. If you would like to use a newer version of printf, for example the one shipped with your OS, try ``command printf``.
|
||||
|
||||
Example
|
||||
------------
|
||||
|
||||
Reference in New Issue
Block a user