[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 ]
> 
> fails with several errors ( ']' not found, and != command not found )

Bear in mind that the [ command is also known as the 'test' command. Try 
'help test' in bash.

The OR operator in a test command is -o.

Steve Early
sde1000@cam.ac.uk


Reply to: