Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!tymix!romana!jms From: jms@romana.Tymnet.COM (Joe Smith) Newsgroups: comp.unix.shell Subject: Re: execute stdin ? Summary: "sh -s" Message-ID: <1244@romana.Tymnet.COM> Date: 27 Sep 90 00:00:25 GMT References: <3335@gmdzi.gmd.de> Reply-To: jms@tardis.Tymnet.COM (Joe Smith) Distribution: comp Organization: BT Tymnet, San Jose, CA Lines: 13 In article <3335@gmdzi.gmd.de> wittig@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@tardis.tymnet.com or jms@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."