I expected printf %s '\<octal_character_value>'
to do the trick, but it doesn't:
printf %s '\101'
Outputs:
\101
I expected printf %s '\<octal_character_value>'
to do the trick, but it doesn't:
printf %s '\101'
Outputs:
\101
Presumably you want
%b
. Fromhelp printf
:And:
I don't know if it works for Unicode characters in general.
You can use Awk:
Or the awk Velour library:
It works with unicode as long as you type out the byte.
The
%b
operator isn't necessary (as long as your octals aren't\0NNN
form, at least in the macOS 11.5 bash3 built-in, the macOS BSD-UNIXprintf
, and alsognu-printf 8.32
.This character is
U+B000
(n=45,056). The decomposed one is more verbose but works the same