hello,
could someone please tell me, why the bracket [highlight #EF2929]}[/highlight] appears on the output?
Code:
$ ( echo A B C D ::;sed 's/\(.\{1\}\)/\1 /g' vvvv|sort|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 ] && echo "errors: A and B and C and D" || { [ $A -eq 1 -a $B -eq 0 -a $C -eq 0 -a $D -eq 0 ] && echo "errors: A" || { [ $A -eq 1 -a $B -eq 1 -a $C -eq 0 -a $D -eq 0 ] && echo "errors: A and B" || { [ $A -eq 1 -a $B -eq 1 -a $C -eq 1 -a $D -eq 0 ] && echo "errors: A and B and C" || { [ $A -eq 1 -a $B -eq 1 -a $C -eq 0 -a $D -eq 1 ] && echo "errors: A and B and D" || { [ $A -eq 1 -a $B -eq 0 -a $C -eq 1 -a $D -eq 1 ] && echo "errors: A and C and D" || { [ $A -eq 1 -a $B -eq 0 -a $C -eq 0 -a $D -eq 1 ] && echo "errors: A and D" || { [ $A -eq 1 -a $B -eq 0 -a $C -eq 1 -a $D -eq 0 ] && echo "errors: A and C" || { [ $A -eq 0 -a $B -eq 1 -a $C -eq 0 -a $D -eq 0 ] && echo "errors: B" || { [ $A -eq 0 -a $B -eq 1 -a $C -eq 1 -a $D -eq 0 ] && echo "errors: B and C" || { [ $A -eq 0 -a $B -eq 1 -a $C -eq 1 -a $D -eq 1 ] && echo "errors: B and C and D" || { [ $A -eq 0 -a $B -eq 1 -a $C -eq 0 -a $D -eq 1 ] && echo "errors: B and D" || { [ $A -eq 0 -a $B -eq 0 -a $C -eq 1 -a $D -eq 0 ] && echo "errors: C" || { [ $A -eq 0 -a $B -eq 0 -a $C -eq 1 -a $D -eq 1 ] && echo "errors: C and D" || { [ $A -eq 0 -a $B -eq 0 -a $C -eq 0 -a $D -eq 1 ] && echo "errors: D" || [highlight #FCE94F]echo "errors: none"[/highlight] }; } } } } } } } } } } } } } }; unset A B C D;done )
A B C D ::
0 0 0 0 :: errors: none [highlight #EF2929]}[/highlight]
0 0 0 1 :: errors: D
0 0 1 0 :: errors: C
0 0 1 1 :: errors: C and D
0 1 0 0 :: errors: B
0 1 0 1 :: errors: B and D
0 1 1 0 :: errors: B and C
0 1 1 1 :: errors: B and C and D
1 0 0 0 :: errors: A
1 0 0 1 :: errors: A and D
1 0 1 0 :: errors: A and C
1 0 1 1 :: errors: A and C and D
1 1 0 0 :: errors: A and B
1 1 0 1 :: errors: A and B and D
1 1 1 0 :: errors: A and B and C
1 1 1 1 :: errors: A and B and C and D
$
the input file is:
Code:
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111