One downside of printf is performance because the built-in shell echo is much faster. This comes into play particularly in Cygwin where each instance of a new command causes heavy Windows overhead. When I changed my echo-heavy program from using /bin/echo to the shell's echo the performance almost doubled. It's a trade off between portability and performance. It's not a slam dunk to always use printf.
John
- 71
- 1
- 1