help with pipes

Chris Buxton cbuxton at
Mon Feb 23 09:09:28 PST 2009

On Feb 21, 2009, at 6:13 PM, Robert Connolly wrote:

> For example:
> patch -p1 < ../loop-AES-v3.2e-20090112.diff
> works, but
> patch -p1 < $(bzcat ../loop-AES-v3.2e-20090112.diff.bz2)
> does not (ambiguous redirect).

The '<' character tells bash to read stdin from the file given. Your  
second example, $(bzcat ...), yields a text stream, not a filename, so  
you must use '<<<' to turn that into stdin for the patch command  
(unless you pipe the output using '|').

Chris Buxton
Professional Services
Men & Mice

More information about the hlfs-dev mailing list