0

This question is about pipes, and I have created a small problem to illustrate my issue. Suppose I have a file:

// foo.csv
a,b,c
d,e,f

In script bar.sh, I do the following:

A=`mktmp -u`
B=`mktmp -u`
mkfifo $A
mkfifo $B

cat foo.csv | tee $A > $B

paste -d ',' <(cat $A) <(cat $B)

rm $A $B

I expect the following output:

a,b,c,a,b,c
d,e,f,d,e,f

Instead, the program hangs due to pipes continuing to listen for more input.

How do I implement this pattern as concisely and simply as possible?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.