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

[microblaze-uclinux] settings.sh



Hi,

The following line in the settings.sh settings file causes problems with
login shells:

elif [ `basename $0` == $script_name ]; then

The problem is that $0 returns the shellname prefixed with '-' (ex. -ksh)
for login shells and this is interpreted as an option by basename
resulting in:

$ source ./settings.sh
-ksh: basename: -k: unknown option
-ksh: basename: -s: unknown option
-ksh: basename: -h: unknown option
Usage: basename [ options ] string [suffix]
-ksh: .[25]: [: argument expected

A fix for this that strips the '-' is below:

25c25
< elif [ `basename $0` == $script_name ]; then
---
> elif [ `basename \`echo $0 | sed 's/^-//'\`` == $script_name ]; then

Thanks,
Bob

___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/