execute stdin ?

Joe Smith jms at romana.Tymnet.COM
Thu Sep 27 10:00:25 AEST 1990


In article <3335 at gmdzi.gmd.de> wittig at gmdzi.gmd.de (Georg Wittig) writes:
>Is it possible (in sh or in csh) to execute a program that is read from stdin?

Yes, use the "-s" option to sh.  For example:

	(echo 'ls -l $1'; echo 'wc $1') | sh -s /etc/motd

As simple as that.
-- 
Joe Smith (408)922-6220 | SMTP: jms at tardis.tymnet.com or jms at gemini.tymnet.com
BT Tymnet Tech Services | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms
PO Box 49019, MS-C41    | BIX: smithjoe | 12 PDP-10s still running! "POPJ P,"
San Jose, CA 95161-9019 | humorous dislaimer: "My Amiga 3000 speaks for me."



More information about the Comp.unix.shell mailing list