From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id EAA22635 for ; Tue, 11 Jun 1996 04:28:19 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id OAA27612; Mon, 10 Jun 1996 14:15:46 -0400 (EDT) Resent-Date: Mon, 10 Jun 1996 14:15:46 -0400 (EDT) From: gene@bear.com Message-Id: <9606101807.AA03486@bear.com> Date: Mon, 10 Jun 1996 14:07:15 -0400 X-Company: Bear Stearns & Co X-Phone: (212) 272-2944 X-Mailer: Mail User's Shell (7.2.2 4/12/91) To: zsh-workers@math.gatech.edu Subject: Re: Re: is this really correct Resent-Message-ID: <"Swy7e3.0.Jl6.HP6ln"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1312 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu [on Jun 10 Hrvoje Niksic said] > > % a="-s"; if [ "$a" = "-s" ] ; then echo "yeh" ; fi > > exists and has a size greater than zero :-). This works for me: > $ echo hi > = > $ a="-s"; if [ "$a" = "-s" ] ; then echo "yeh" ; fi > yeh > >End included message on "Re: Is this really correct ?" I like this, the problem is, for this to be really useful we need: if [ "$a" = "-s" ] ; then echo "hi" > = ; fi if [ "$a" = "-s" ] ; then echo "yeh" ; fi But the first if fails .... :-) Joking aside, this may be correct, but it kind of fails the "gee whiz" behaviour test. I suppose one would use a 'case' statement. What is the "preferred" way of testing strings that may be arbitrarily input then given the above ? I mean one does not know what 'a' is until you do a test on it right ? Gene gene@bear.com -- ******************************************************************************* Bear Stearns is not responsible for any recommendation, solicitation, offer or agreement or any information about any transaction, customer account or account activity contained in this communication. *******************************************************************************