Comments (1)
  • Add a Comment
  • Edit
  • More Actions v
  • Quarantine this Entry

1 PontiacGeronimo commented Permalink

example: <div>&nbsp;</div> a=0 b=0 c=0 d=0;until [ $a -eq 2 ];do until [ $b -eq 2 ]; do until [ $c -eq 2 ];do until [ $d -eq 2 ];do echo ${a} ${b} ${c} ${d};((d+=1));done;d=0;((c+=1));done;c=0;((b+=1));done;b=0;((a+=1));done|while read A B C D;do printf "$A $B $C $D :: "; [ $A -eq 1 -a $B -eq 1 -a $C -eq 1 -a $D -eq 1 ] &amp;&amp; echo "errors: A and B and C and D" || { [ $A -eq 1 -a $B -eq 0 -a $C -eq 0 -a $D -eq 0 ] &amp;&amp; echo "errors: A" || { [ $A -eq 1 -a $B -eq 1 -a $C -eq 0 -a $D -eq 0 ] &amp;&amp; echo "errors: A and B" || { [ $A -eq 1 -a $B -eq 1 -a $C -eq 1 -a $D -eq 0 ] &amp;&amp; echo "errors: A and B and C" || { [ $A -eq 1 -a $B -eq 1 -a $C -eq 0 -a $D -eq 1 ] &amp;&amp; echo "errors: A and B and D" || { [ $A -eq 1 -a $B -eq 0 -a $C -eq 1 -a $D -eq 1 ] &amp;&amp; echo "errors: A and C and D" || { [ $A -eq 1 -a $B -eq 0 -a $C -eq 0 -a $D -eq 1 ] &amp;&amp; echo "errors: A and D" || { [ $A -eq 1 -a $B -eq 0 -a $C -eq 1 -a $D -eq 0 ] &amp;&amp; echo "errors: A and C" || { [ $A -eq 0 -a $B -eq 1 -a $C -eq 0 -a $D -eq 0 ] &amp;&amp; echo "errors: B" || { [ $A -eq 0 -a $B -eq 1 -a $C -eq 1 -a $D -eq 0 ] &amp;&amp; echo "errors: B and C" || { [ $A -eq 0 -a $B -eq 1 -a $C -eq 1 -a $D -eq 1 ] &amp;&amp; echo "errors: B and C and D" || { [ $A -eq 0 -a $B -eq 1 -a $C -eq 0 -a $D -eq 1 ] &amp;&amp; echo "errors: B and D" || { [ $A -eq 0 -a $B -eq 0 -a $C -eq 1 -a $D -eq 0 ] &amp;&amp; echo "errors: C" || { [ $A -eq 0 -a $B -eq 0 -a $C -eq 1 -a $D -eq 1 ] &amp;&amp; echo "errors: C and D" || { [ $A -eq 0 -a $B -eq 0 -a $C -eq 0 -a $D -eq 1 ] &amp;&amp; echo "errors: D" || echo "errors: none"; } } } } } } } } } } } } } }; unset A B C D;done