3 ms·
I've been using bash for nearly two decades, and I just found out that Bash is apparently the only shell whose built-in echo uses the -e option. I thought other
by peterwwillis 7y ago
I've been using bash for nearly two decades, and I just found out that Bash is apparently the only shell whose built-in echo uses the -e option. I thought others used this too, but it seems every other shell's echo just implicitly interpolates escaped characters. POSIX actually says anything following '\' is undefined behavior. Apparently printf is the only portable way to interpolate escaped characters in output.
Here's a bunch of very useful tips like that: https://www.etalabs.net/sh_tricks.html https://www.etalabs.net/sh_tricks.html
- kohtatsu 7y agoThat resource is lovely, thank you.