bourne shell query

Michael Meissner meissner at osf.org
Fri Sep 7 02:24:32 AEST 1990


In article <1990Sep6.141133.3391 at usenet.ins.cwru.edu>
chet at cwns1.CWRU.EDU (Chet Ramey) writes:

| In article <SCOTT.90Sep5124415 at tab29.larc.nasa.gov>
| scott at tab29.larc.nasa.gov (Scott Yelich) writes:
| 
| >1) if [ "$1" = "$2" ]; then
| >     echo "Yeas!"
| >   else
| >     echo "No-way!"
| >   fi
| 
| What if $1 = '=' or '-t'?

The standard way of dealing with this is:

if [ x"$1" = x"$2" ]; then
	echo "Yeas!"
else
	echo "No-way!"
fi
--
Michael Meissner	email: meissner at osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142

Do apple growers tell their kids money doesn't grow on bushes?



More information about the Comp.unix.shell mailing list