Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.5: Fix the echo -n problem in 10.5' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Fix the echo -n problem in 10.5
Authored by: antifuchs on Nov 20, '07 02:52:40PM
This is not a bug. As OS X 10.5 is now certified to follow the Single Unix Specification, its /bin/sh and echo builtin now follow the specification: http://www.opengroup.org/onlinepubs/007908799/xcu/echo.html

The -n switch is a bash add-on, so if you want to use this in your shell scripts, it is advisable to fix these shell scripts to use #!/bin/bash, and not to replace the strictly standards-compliant /bin/sh in OS X with the one that's not.

[ Reply to This | # ]
10.5: Fix the echo -n problem in 10.5
Authored by: hypert on Nov 26, '07 09:28:05AM
Note the other item mentioned on that page too:
New applications are encouraged to use printf instead of echo.
I had read something like that years ago and switched to printf (and sometimes just plain "print" for most of my shell scripts (usu. /bin/sh in Solaris 2.8)).

[ Reply to This | # ]