Re: Can $1 be set in a script?



On Thu, 30 Mar 2006 21:21:07 GMT, larryalk <nobody@xxxxxxxxxxx> wrote:

To be clearer, assuming a script called with or without a $1
how can I can assign the (possibly non-existant) $1 to something?

Try:

FRED="something"

if [ -n $1 ]; then
FRED=$1
fi

or similar function as part of a case construct.

That what you mean? A default if $1 value not specified on CLI?

Grant.
--
Memory fault -- brain fried
.