
#!/bin/sh
echo -n "Insert Name: "
read NAME
echo "Hello ${NAME}!"#!/bin/bash
Unfortunately, that only affects you. If there are other scripts you are running that you don't want to modify yourself, then you need to do something more drastic.Because OS X uses bash for both /bin/sh and /bin/bash, it seems reasonable that they should be the same. It turns out that they aren't:
$ ls -l /bin/sh /bin/bash
-rwxr-xr-x 1 root wheel 1244912 Sep 23 18:41 /bin/bash
-r-xr-xr-x 1 root wheel 1244944 Sep 23 18:45 /bin/sh
Notice that bash is 32 bytes off of sh here. Both, however, return that they are bash:
$ /bin/sh --version
GNU bash, version 3.2.17(1)-release (i386-apple-darwin9.0)
Copyright (C) 2005 Free Software Foundation, Inc.
$ /bin/bash --version
GNU bash, version 3.2.17(1)-release (i386-apple-darwin9.0)
Copyright (C) 2005 Free Software Foundation, Inc.
So, since /bin/bash works, and /bin/sh doesn't, and the binaries are different, you can fix all this by just renaming /bin/sh to something else, and then copying /bin/bash to /bin/sh (before doing any of this, make appropriate backups):
$ sudo mv /bin/sh /bin/sh.orig
$ sudo cp /bin/bash /bin/sh
You should now have a working echo -n from here on. Hopefully they will fix this in a later release of 10.5.
[robg adds: I can confirm this still seems broken in 10.5.1.]

