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

Re: ash vs. bash

On Sun, Jul 25, 1999 at 01:54:25PM +0200, Sarel J. Botha wrote:
 >What if I have scripts on my machine that I wrote myself that use bashisms and
 >#!/bin/sh ? (Not that I do :)

They would break :-). But, again, you can easily check to see whether they
parse correctly with ash by doing (better if not as root :-) :

for i in /usr/local/sbin/* \
         /usr/local/bin/* \
         /etc/init.d/* \
  if file $i |grep -q -i bourne
    ash -n $i

Ok, I know that parsing the code is one thing and running it may be
a different one, but the above test would give you a pretty accurate
indication anyway. And in fact, I have been running a couple of
systems with /bin/sh -> /bin/ash for almost a week now, across reboots
and apt-get's, without any problems at all.

Then, if you absolutely need bash extentions in new scripts you should
start them with #!/bin/bash.

Carlo Strozzi       PGP Public Key fingerprint :
ED 4A 7A 6C 88 66 1B 34  06 14 FC 2E C7 EA F2 EE

Against software patents:
http://www.freepatents.org - http://no-patents.prosa.it

Reply to: