comm '! sort file1' '! sort file2'

Arthur David Olson ado at elsie.UUCP
Sat Oct 11 03:26:40 AEST 1986


On the floor:  allowing something such as
	comm '! sort file1' '! sort file2'
to set up multiple pipes into a command.

In article <830003 at hpcnoe.UUCP>, jason at hpcnoe.UUCP (Jason Zions) writes:
> It can be done easily on SYSV, using fifo's. . .This is what you do,
> after creating the fifo (mknod -p ~/fifo).
>
> sort file1 > ~/fifo & sort file2 | comm - ~/fifo

In article <3724 at umcp-cs.UUCP> chris at umcp-cs.UUCP (Chris Torek) writes:
> Unfortunately, one must be root to create a fifo, no?

In article <264 at desint.UUCP>, geoff at desint.UUCP (Geoff Kuenning) writes:
> . . .I just did "mknod fifo p" from a normal account, and it worked. . .

And in this article I write:
Even if a normal can create a fifo, it may not be the wisest thing to do.
Think of the havoc that results if I put a
	sort "$1" > ~/fifo & sort "$2" | comm - ~/fifo
command into a shell script (named, for example, "scomm") and then,
six months from now when I've forgotten the implementation details,
type in
	scomm firstfile secondfile > results &
	scomm thirdfile fourthfile > moreresults &

The "/dev/fd/n" mechanism discussed in other recent postings doesn't suffer
from this defect.
--
UNIX is a registered trademark of AT&T.
--
	UUCP: ..decvax!seismo!elsie!ado   ARPA: elsie!ado at seismo.ARPA
	DEC, VAX, Elsie & Ado are Digital, Borden & Ampex trademarks.



More information about the Comp.unix.wizards mailing list