WYE(1)

NAME
wye - another pipe fitting

SYNOPSIS
`subcommand | wye`    (note the backquotes!)

DESCRIPTION
The wye utility is used to create systems of pipes and fifos (named pipes) more complicated than standard shell syntax allows. A single invocation of wye has the following effect: a temporary fifo is created; the name of this fifo is printed on standard output; and wye exits, leaving a child process in the background to copy any data received on standard input to the fifo. The net effect of this is that you can use the expression `subcommand | wye` anywhere on a command line that you would use a filename, and the output of subcommand will be piped appropriately to create the illusion that `subcommand | wye` is a file, containing the output of subcommand.

EXAMPLES
Since wye is a simple command, I have given it a simple description; however, some examples are certainly in order. To print all lines of the standard input which contain the name of a file in the current directory:
	fgrep -f `ls | wye`
To show which users log on or off in the next minute:
	diff -h `who | wye` `sleep 60; who | wye`
To change the names of all the files in the current directory to lowercase:
	paste `ls | wye` `ls | tr A-Z a-z | wye` | xargs -n2 mv

FILES
/tmp/wye.??????    temporary fifos

BUGS
The background wye process has a (hardcoded) one-hour timeout: if the fifo is not opened for reading by another process in that time, then the background wye process will terminate silently. Note that this will probably never happen unless the user has made a mistake and forgotten to use the fifo for anything.

There is no equivalent of mkstemp(3) for fifos, so we must provide the same functionality ourselves with mktemp(3) and mkfifo(2), repeating the calls if EEXIST is returned.

AUTHOR
Michael Constant (mconst@csua.berkeley.edu).

SEE ALSO
mktemp(3), mkstemp(3), mkfifo(2), tee(1)