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: Greg Wooledge
Subject: Re: Design question(s), re: why use of tmp-files or named-pipes(/dev/fd/N) instead of plain pipes?
Date: Mon, 19 Oct 2015 15:59:01 -0400
User-agent: Mutt/1.4.2.3i

On Mon, Oct 19, 2015 at 12:49:25PM -0700, Linda Walsh wrote:
> Greg Wooledge wrote:
> >A simple example:
> >
> >diff -u <(sort file1) <(sort file2)
> ----
>       You claim <(sort file1) is a filename?

$ ls -l <(sort .bashrc)
lr-x------ 1 wooledg wooledg 64 Oct 19 15:56 /dev/fd/63 -> pipe:[55954]

ls thinks it is.

The whole point of this construction is that it generates a thing that
can be open()ed by a program that isn't bash.  So you can drop it into
programs that require a filename argument, like diff.

Nobody ever said it's a regular file.



reply via email to

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