Article View: comp.unix.shell
Article #1083Re: bourne shell query
From: Michael Meissner
Date: Thu, 06 Sep 1990 16:24
Date: Thu, 06 Sep 1990 16:24
26 lines
1179 bytes
1179 bytes
In article <1990Sep6.141133.3391@usenet.ins.cwru.edu> chet@cwns1.CWRU.EDU (Chet Ramey) writes: | In article <SCOTT.90Sep5124415@tab29.larc.nasa.gov> | scott@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@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?
Technical Details
Message-ID:
<MEISSNER.90Sep6122432@osf.osf.org>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!snorkelwacker!paperboy!meissnerReferences:
<75@iconsys> <925@hls0.hls.oz> <SCOTT.90Sep5124415@tab29.larc.nasa.gov> <1990Sep6.141133.3391@usenet.ins.cwru.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!snorkelwacker!paperboy!meissner From: meissner@osf.org (Michael Meissner) Newsgroups: comp.unix.shell Subject: Re: bourne shell query Message-ID: <MEISSNER.90Sep6122432@osf.osf.org> Date: 6 Sep 90 16:24:32 GMT References: <75@iconsys> <925@hls0.hls.oz> <SCOTT.90Sep5124415@tab29.larc.nasa.gov> <1990Sep6.141133.3391@usenet.ins.cwru.edu> Sender: news@OSF.ORG Organization: Open Software Foundation Lines: 26 In-reply-to: chet@cwns1.CWRU.EDU's message of 6 Sep 90 14:11:33 GMT