4 ms·
I've used the -e option in GNU's echo many times. The various other versions are strictly less useful to me. Does the option really belong in echo? Who knows,
by vinkelhake 11y ago
I've used the -e option in GNU's echo many times. The various other versions are strictly less useful to me.
Does the option really belong in echo? Who knows, but it's certainly been useful to me.
UNIX fifth edition goes for absolute minimalism. Echo in Plan 9 is apparently used enough that it's worthwhile to optimize the number of times write is called. FreeBSD echo looks like someone just learned about writev. OpenBSD's seem like the sanest of the minimalists.
What's the takeaway for you?
- laumars 11y agoI've used -e on GNU's `echo` quite a bit as well. But FreeBSD also supports `printf` (as does Linux by the way), so it's not a great inconvenience the missing -e flag on FreeBSD's `echo`. $ printf "This\tis an\nexample\n" This is an example You can also use the usual C-style printf parameters as well: $ printf "This is %-20s example\n" another This is another example
- JdeBP 11y ago> What's the takeaway for you? For many people, from the writers of the Single Unix Specification to the Debian Policy people, the take-away was and is use printf, for nigh on 20 years now. * https://www.debian.org/doc/manuals/debian-reference/ch12.en.html#_posix_shell_compatibility https://www.debian.org/doc/manuals/debian-reference/ch12.en.... * http://pubs.opengroup.org/onlinepubs/7908799/xcu/echo.html#tag_001_014_525 http://pubs.opengroup.org/onlinepubs/7908799/xcu/echo.html#t... * https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=490605 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=490605 * http://www.in-ulm.de/~mascheck/various/echo+printf/ http://www.in-ulm.de/~mascheck/various/echo+printf/ * http://mywiki.wooledge.org/Bashism#Builtins http://mywiki.wooledge.org/Bashism#Builtins * https://wiki.ubuntu.com/DashAsBinSh#echo https://wiki.ubuntu.com/DashAsBinSh#echo * https://lwn.net/Articles/346028/ https://lwn.net/Articles/346028/