🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1246

Re: execute stdin ?

#1246
From: Joe Smith
Date: Thu, 27 Sep 1990 00:00
13 lines
1030 bytes
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."
Technical Details
Message-ID: <1244@romana.Tymnet.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!tymix!romana!jms
References: <3335@gmdzi.gmd.de>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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