INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

a complex text in ksh

a complex text in ksh

(OP)

hello,

could someone please tell me, why the bracket } 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" || echo "errors: none" }; } } } } } } } } } } } } } }; unset A B C D;done )
A B C D ::
0 0 0 0 :: errors: none }
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 

RE: a complex text in ksh

(OP)
indeed, thank you.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close