You are not logged in.
Pages: 1
I found a line in Greg's Wiki I cannot find an explanation for:
>printf '%d' "'A" # double quotes + 1 single quote
65
>printf '%d' "'A'" # double quotes + 2 single quotes
65
>printf '%d' 'A' # just single quotes
bash: printf: A: invalid number
0
>printf '%d' '"A"'
65
>printf '%d' '"A' # single quotes + 1 double quote
65
Can somebody perhaps tell me where this behaviour is explained?
Offline
Ok, accidently found out that this is printf specific. (Strangly neither in man pages nor in "info coreutils 'printf invocation'" mentioned.)
Offline
It is mentioned in the textinfo page.
If the leading character of a numeric argument is `"' or `'' then
its value is the numeric value of the immediately following
character.
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
If you've got your answers, please remember to mark the thread as solved.
https://bbs.archlinux.org/viewtopic.php?id=130309
Offline
Pages: 1