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

Re: sh script Q



Ariel Biener wrote:

> Which will result in the script fo fail if $PARAM is undefined.
> 
> Vadim's suggestion wasn't just a matter of semantics.
> 
> --Ariel
> > Vadim Vygonets <vadik@cs.huji.ac.il> writes:
> >
> > > > [ "$PARAM" != "SOMETHING" ] || {
> > > > ;}
> > > I think that it's better to do:
> > > if [ "X$PARAM" != "XSOMETHING" ]; then .....
> >
> > Yes you right it's more unix, but i usually use the "$PARAM" !=
> > "SOME".

Hmm.


	$ test "$FROB" != "" || echo "frob!"
	frob!
	$ 

Hrmph.