paste without temporary files in Unix

后端 未结 4 1723
一个人的身影
一个人的身影 2021-01-31 04:10

I\'m trying to use the Unix command paste, which is like a column-appending form of cat, and came across a puzzle I\'ve never known how to solve in Unix.

How can you use

4条回答
  •  不知归路
    2021-01-31 04:54

    Use named pipes (FIFOs) like this:

    mkfifo fA
    mkfifo fB
    progA > fA &
    progB > fB &
    paste fA fB
    rm fA fB
    

    The process substitution for Bash does a similar thing transparently, so use this only if you have a different shell.

提交回复
热议问题