dotfiles/bin/build/src/wye/wye.1
michener 83d40113d2 First import
git-svn-id: http://photonzero.com/dotfiles/trunk@1 23f722f6-122a-0410-8cef-c75bd312dd78
2007-03-19 06:17:17 +00:00

59 lines
2.2 KiB
Groff

.\" $Id: wye.1,v 1.1 1999-05-03 10:04:59-07 mconst Exp mconst $
.TH WYE 1
.fi
.SH NAME
wye \- another pipe fitting
.SH SYNOPSIS
\fC`\fIsubcommand\fP | wye`\fR (note the backquotes!)
.SH DESCRIPTION
The \fCwye\fR utility is used to create systems of pipes and fifos
(named pipes) more complicated than standard shell syntax allows.
A single invocation of \fCwye\fR has the following effect: a temporary
fifo is created; the name of this fifo is printed on standard output;
and \fCwye\fR 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 \fC`\fIsubcommand\fP | wye`\fR
anywhere on a command line that you would use a filename, and the output of
\fIsubcommand\fP will be piped appropriately to create the illusion that
\fC`\fIsubcommand\fP | wye`\fR is a file, containing the output of
\fIsubcommand\fR.
.SH EXAMPLES
Since \fCwye\fR 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:
.nf
\fCfgrep \-f `ls | wye`\fR
.fi
To show which users log on or off in the next minute:
.nf
\fCdiff \-h `who | wye` `sleep 60; who | wye`\fR
.fi
To change the names of all the files in the current directory to lowercase:
.nf
\fCpaste `ls | wye` `ls | tr A\-Z a\-z | wye` | xargs \-n2 mv\fR
.fi
.SH FILES
\fC/tmp/wye.??????\fR temporary fifos
.SH BUGS
The background \fCwye\fR process has a (hardcoded) one-hour timeout: if the
fifo is not opened for reading by another process in that time, then the
background \fCwye\fR 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.
.PP
There is no equivalent of \fCmkstemp\fR(\fC3\fR) for fifos, so we
must provide the same functionality ourselves with \fCmktemp\fR(\fC3\fR)
and \fCmkfifo\fR(\fC2\fR), repeating the calls if
.SM EEXIST
is returned.
.SH AUTHOR
Michael Constant (mconst@csua.berkeley.edu).
.SH "SEE ALSO"
\fCmktemp\fR(\fC3\fR), \fCmkstemp\fR(\fC3\fR), \fCmkfifo\fR(\fC2\fR),
\fCtee\fR(\fC1\fR)