april
1
In my ksh script, if the conditions of a if statement are true, then do nothing; otherwise, execute some commands.
How do I write the "do nothing" statement in the following example?
Example:
if (( "$x"="1" && "$y"="a" && "$z"="happy" ))
then
do nothing
else
command
command
fi
Thanks.
aigles
2
if (( "$x"="1" && "$y"="a" && "$z"="happy" ))
then
:
else
command
command
fi
Another way, invert your test :
if (( "$x"!="1" || "$y"!="a" || "$z"!="happy" ))
then
command
command
fi
Jean-Pierre.
if (( "$x"="1" && "$y"="a" && "$z"="happy" )); then
:
else
command
command
fi