Re:Pure Sh Bible
by hddqsb on Tuesday May 02, 2023 @09:56AM
(#35787450)
Yes. printf is not a "flex", it's the only safe way to display arbitrary strings. The link mentions one good reason to avoid echo (string might be "-n"), but another important reason is that the behaviour of echo is implementation-defined if the string contains backslashes (e.g. `echo 'foo\nbar'` displays one line in bash but two lines in dash and zsh).
[ Parent
| on HN ]
There are no comments on this comment yet.