Why is printf better than echo?
unix.stackexchange.com
unix.stackexchange.com
The printf command means "print, formatted," where "format" refers to "positional parameters," and this functionality is not present in echo.
Signed, a Unix aficionado.
The arcane UX that POSIX gives us has no connection or correlation whatsoever with the power of the system.
For instance, an enhanced IPython shell alone would be 10x better than bash. You wouldn't loose any power in this manner.
In fact, I think it would be good if thought about or reflected on what exactly "power" is. IMO, it's programmability / script-ability. And Python (again, imo) is a much better language than bash -- hence a shell based on it would deliver a far better UX than bash ever would.
Clearly the Bourne shell and its descendents must have been doing something right.
The language has nothing to do with why someone picks a shell. They just get used to something, it becomes good enough, and they get on with life. We don't need the most powerful, the most flexible, the most efficient thing. We just need something simple that works. Bash works, so stop nit-picking.
It's good to know (while the key takeaway lesson is "use printf"):
# bash
$ echo -n
$ echo -- -n
-- -n
$ echo - -n
- -n
# zsh
$ echo -n
$ echo -- -n
-- -n
$ echo - -n
-n echo -e '\x2d\x6e'
echo '' -necho -n - ; echo n
As a former Sun consultant, the most common question I had to fend from customers during those 10 years was the lack of a printf. Fortunately, Odersky has much better taste & Scala shipped with a printf on day 1 in Predef.scala, via Console(https://github.com/scala/scala/blob/v2.10.1/src/library/scal... )