Re: [ILUG] what does this shell script mean

From: Vincent Cunniffe (vincent at domain cunniffe.net)
Date: Wed 09 May 2001 - 09:39:31 IST


hrishy samant wrote:

> hello
>
> could anybody explain me this shell script
 
<schip>

> can anybody explain what this &&set_level 1 means

It's a logical AND statement, used as a trick to run a subsequent
command *only* if the first command returned a 'success' value.

The evaluation of the expression (X && Y) is false if either X *or* Y
are false, so Y will not even be evaluated if X is found false.

This is fairly commonly used, in commands such as :

        make && make install

which will only run the second installation command if the compilation
stage is found to have worked.

Regards,

Vin



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:10:14 GMT