Just thought someone else might encounter the same problem. If your
initialization file for bash has the option cdspell set, such as
through the following command
shopt -s cdspell
then the bin directory may not be set correctly in the shell script
that set bin through the following command
bin=`cd "$bin"; pwd`
An alternative is to make sure cdspell is not set. The second
alternative is to set the value of bin through
cd "$bin" && bin=${PWD}
This allows bin to take on the correct value no matter whether cdspell
is set or not.
John