in reply to Re^2: passing pipes on the command line
in thread passing pipes on the command line

hmm.. nice... so that just passes a FIFO as the filename...
  • Comment on Re^3: passing pipes on the command line

Replies are listed 'Best First'.
Re^4: passing pipes on the command line
by Mugatu (Monk) on Mar 23, 2005 at 20:39 UTC

    Exactly. It's a very nice trick when you have a program that expects to read from a file, and has no facilities for reading from STDIN. A common example is diff:

    diff <(grep foo file1 | sort -u) \ <(grep foo file2 | sort -u)

    Of course, we have rapidly veered off topic for the Monastery, so I digress. :-)

      Sure, it's very useful. Of course, diff can read one of its inputs from stdin, so you can use

      grep foo file1 | sort -u | diff - <( grep foo file2 | sort -u )