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

Re: bash, dash and sh



jeremy bentham wrote:
> I am finally abandonning my fifteen-year-old computer and Lenny
> for a six (?) year old used Gateway 2802 (as a Bad Consumer
> (tm) I never buy anything new if I can avoid it) and, right now,
> it has a start at Wheezy on it.

Congratulations on your recent upgrade.  I am sure you will enjoy it.

> I happened to read on another list, and then verified for myself,
> that /bin/sh is now a link to dash, instead of bash.

Yes.

> If I
> 
> cd /bin
> sudo rm sh; ln -s bash sh
> 
> will I break a bunch of stuff?

You have an error in the above.  You have sudo for the first command,
the rm, but not for the second command, the ln.

Do it in one command instead.

  sudo ln -sfn bash /bin/sh

Note that I didn't test the above but I believe it will work.

> I have a bunch of scripts 
> 
> (ls -1 ~/bin | wc
>    138   139   1302)
> 
> with the first line #!/bin/sh that use bashisms, and the above
> would be a lot easier than editing each one (of course, maybe
> just editing each one would be easier than doing this ;-) ).

I suggest editing each one of those.  Changing /bin/sh just treats a
symptom.  Changing the #! line is the Right Thing to do.

Do every single one of those contain bashisms?  That seems unlikely.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: