Re: Shellpipes in Read (was Re^2: FVWM: Global fvwm configuration)

From: Jim Nicholson <pcks_at_cnj.digex.net>
Date: Thu, 30 May 1996 10:04:12 -0400 (EDT)

On Thu, 30 May 1996 chuck_hines_at_VNET.IBM.COM wrote:

> >>>>> "Peter" == Peter Funk <pf_at_artcom0.north.de> writes:
>
> Peter> Quoting Martin Kraemer:
> Peter> [...]
> mk> Or, using the Pipe mechanism I saw on this list earlier on (and which I
> mk> think would be _very_ useful to include as a standard feature), one
> mk> could easily write
> mk> Read "| [ -f $HOME/.fvwm2rc ] && cat $HOME/.fvwm2rc || cat /usr/lib/X11/fvwm2/system.fvwm2rc"
>
> Peter> This syntax is very misleading! A leading vertical bar ('|')
> Peter> suggests, that the process will open the pipe for writing
> Peter> instead of reading.
>
> I thought that initially too, and was thinking that 'Read "< cmd"'
> might be better. But then that would look like file redirection...

Actually, read "| cmd" is similar to perl's open(HANDLE,"| cmd"). Perl
starts the pipeline; reads to HANDLE get cmd's stdout, while writes to
handle are placed on cmd's stdin. Perl *DOES* support
open(HANDLE,"cmd |"), in which case you can read HANDLE to get cmd's
stdout, but cmd gets an eof on stdin reads.

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Thu May 30 1996 - 09:38:32 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:59 BST