Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Re: is this really correct



[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@xxxxxxxx

--
*******************************************************************************
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.
*******************************************************************************




Messages sorted by: Reverse Date, Date, Thread, Author