2485 shaares
83 private links
83 private links
To print e.g. newline characters with bash printf which interprets the characters EVEN FROM A VARIABLE, do printf "%b" "my\nnewline\nvariable"
.
printf's %b
format specifier was meant specifically to replace echo -e
(actually, the XSI extension to echo which calls for special interpretation of the arguments by default. -e was never specified and is disallowed by POSIX.), and is identical in virtually every way including a few differences from $'...' and the format string argument to printf.