[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: unexpected script output



Nelson Green wrote:
> > Nelson Green grabbed a keyboard and wrote:
> > Change your shebang line to #!/bin/bash to make it work right and then
> > set the executable bit on the script. Then you can just do ./output.sh
> > to get the expected results (don't do "sh output.sh," since that will
> > just invoke /bin/sh which points you back to dash).
> 
> Oops, I thought I had already linked /bin/sh to /bin/bash, but I
> hadn't. I do not like dash, and I have to use bash on a lot of
> non-Debian systems, so I try to keep my environment as similar as I
> can all the way around.

Don't change the symlink.  Change the #! line to #!/bin/bash.  That
is the correct way to use bash specific features.  Then it will work
on the next system that you run it on.  If you change the symlink on
your system then you try to run the script on a different machine then
it in those immortal words it is deja vu all over again.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: