ash or bash not good /bin/sh replacements?
I've been doing tests with ash as a /bin/sh replacement for systems with
small disks, and have been bitten by the following "feature":
If I "source" a script two.sh from another script one.sh, two.sh inherits
the parameters passed to one.sh on the command line, instead of the ones
defined in the "source" call. That is:
one.sh:
======
#!/bin/sh
. two.sh param1 param2
======
two.sh
======
#!/bin/sh
echo $1
echo $2
======
if sh -> bash
$./one.sh nonparam1 nonparam2
param1
param2
$
if sh -> ash
$./one.sh nonparam1 nonparam2
nonparam1
nonparam2
$
Is it a bug in ash or in bash?
( This is not a philosophical issue. Currently init calls /etc/init.d/rcS
without parameters, /etc/init.d/rcS sources /etc/rcS.d/S*.sh with "start" as
the first parameter, and one of those shells, keymaps.sh fails if its
first parameter is not start|restart|force-reload|reload|stop )
Thanks,
--
Enrique Zanardi ezanardi@ull.es
--
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: