RosettaCodeData/Task/Short-circuit-evaluation/UNIX-Shell/short-circuit-evaluation-2.sh
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

12 lines
294 B
Bash

alias a eval \''echo "Called a \!:1"; "\!:1"'\'
alias b eval \''echo "Called b \!:1"; "\!:1"'\'
foreach i (false true)
foreach j (false true)
a $i && b $j && set x=true || set x=false
echo " $i && $j is $x"
a $i || b $j && set x=true || set x=false
echo " $i || $j is $x"
end
end