bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Design question(s), re: why use of tmp-files or named-pipes(/dev/fd/


From: Pierre Gaston
Subject: Re: Design question(s), re: why use of tmp-files or named-pipes(/dev/fd/N) instead of plain pipes?
Date: Thu, 22 Oct 2015 10:32:41 +0300



On Thu, Oct 22, 2015 at 5:57 AM, Linda Walsh <bash@tlinx.org> wrote:

        But only as a pointer to something one can do I/O on.
You can't set any file attributes or metadata on "pipe:[xxxx]" It's not a real file somewhere.

Yes, it's not a regular file, but it not the less true that <( ) gives you a string that can be used by applications that were written to deal with regular files whose names are passed as an argument., or in cases where you need more than one stream.

eg you can compare the output of two commands like:

cmp <(sort fileA) <(sort fileB)

cmp will receive 2 strings as arguments, use these strings as filenames and will open the special files just like if they were regular files.

Yes they are not regular, yes they can not bee seeked and the trick will not work in all cases, but for cmp it will work just as well as with regular files.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]