It didn't work for me, but changing it to

if [ -z $1 ]; then

did, the spaces are required.

david

On Wed, 11 Dec 2002, James Francis wrote:

> > -----Original Message-----
> > From: dbrett [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, December 11, 2002 2:29 PM
> > To: Robert P. J. Day
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: minor bash script issue
> > 
> > 
> > I though your correction would work, but the output still gives me the
> > error message.  I would really like to fix it, but will settle for not
> > seeing the error.
> > 
> > 
> > #!/bin/bash
> > 
> > if [$1 == '']; then
> >         echo ''
> >         echo "format is $0 'math equation'"
> >         echo "i.e. $0 (2+2)*3"
> >         echo ''
> >         exit
> > fi
> > 
> > echo $1 | /usr/bin/bc -l  2>/dev/null
> > 
> > david
> Change your test line to:
> if test "$1" == ''; then
> instead of using the [ ] primitives and you will be golden.
> The [ ] syntax of the test command is having trouble because
> of the parenthesis in your expression.
> 
> JMF
> 
> 
> 
> -- 
> redhat-list mailing list
> unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
> https://listman.redhat.com/mailman/listinfo/redhat-list
> 



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to