Afficher un message
Vieux 05/11/2006, 16h53   #2
Radoulov, Dimitre
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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


  Réponse avec citation
 
Page generated in 0,05388 seconds with 9 queries