Re: obtain the result of a command (success or failure) directly in a if instruction
> I would like to run the command between the brackets: is this possible?
> The following command does not seem to work:
>
> $ if [ `ls bar 1>/dev/null 2>&1` ];then echo success;fi
ls bar >/dev/null 2>&1 && echo success || echo failure
Regards
Dimitre
|