[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Shell scripting in Bash



On Fri, 26 Apr 1996, Dale Scheetz wrote:

> I have been trying to learn shell scripting using the man page for bash.
> Asside from the need for a lot of reading between the lines, there seem to
> be several errors. == is declared to be the equality operator, but = is
> the correct syntax. || is declared to be the or operator, but although:
> 
> if [ a != b ]
> 
> works fine
> 
> if [ a != b || c != d ]
try this:

if [ a != b -o c != d ];then
  bla bla bla
fi

or 

if [ a != b ] || [ c != d ];then
  bla bla bla
fi

> 
> fails with several errors ( ']' not found, and != command not found )
> 
> I have tried to enclose the expressions in {} with the same results.
> 
> What is the correct syntax for this kind of statement?
> 
> TIA,
> 
> Dwarf
> 
> ------------                                          --------------
> 
> aka   Dale Scheetz                   Phone:   1 (904) 877-0257
>       Flexible Software              Fax:     NONE 
>       Black Creek Critters           e-mail:  dwarf@polaris.net
> 
> ------------ If you don't see what you want, just ask --------------
> 

Richard G. Roberto
richr@bear.com
201-739-2886 - whippany, nj


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


Reply to: