3 ms·
No need to invoke a deity to do that... echo 'Hi!' | tee "$(printf "foo\nbar\tqu ux.txt")" cat foo$'\n'bar$'\t'qu' 'ux.txt IIRC the latter only works in k
by mfontani 6y ago
No need to invoke a deity to do that...
echo 'Hi!' | tee "$(printf "foo\nbar\tqu ux.txt")"
cat foo$'\n'bar$'\t'qu' 'ux.txt
IIRC the latter only works in ksh93+, but the former should be fine pretty much in any shell.
- JdeBP 6y ago... except if one uses \c by mistake. \c has unspecified behaviour, and is one of the things that varies widely from one implementation of printf to another. * https://unix.stackexchange.com/a/558665/5132 https://unix.stackexchange.com/a/558665/5132