Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!ames!lll-tis!ptsfa!ihnp4!cbosgd!mandrill!hal!ncoast!robertd From: robertd@ncoast.UUCP (Rob DeMarco) Newsgroups: comp.unix.questions Subject: Re: Shell escapes within piped programs Message-ID: <4241@ncoast.UUCP> Date: Sun, 23-Aug-87 14:21:49 EDT Article-I.D.: ncoast.4241 Posted: Sun Aug 23 14:21:49 1987 Date-Received: Wed, 26-Aug-87 06:42:28 EDT References: <510@cgcha.UUCP> Reply-To: robertd@ncoast.UUCP (Rob DeMarco) Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 52 Keywords: shell pipe In article <510@cgcha.UUCP> wtho@cgcha.UUCP (Tom Hofmann) writes: >I've just had a strange experience with shell escapes within >piped programs. E.g. I called > > ls | more > >and typed > > !mail
> >at the "more" prompt. But instead of being prompted for "Subject:" >and entering text (as I expected), the rest of the listing to be >displayed was mailed to
, and the "more" prompt returned. >The reason, as I think, is that standard input of "more" is not >the terminal but the pipe, and therefore the standard input of the >invoked program is that pipe as well. Therefore "mail" reads from >the pipe and not from the terminal. I tried it both on a SUN and >a CADMUS and got the same (strange) result. I made another test >using "pg" (System V) instead of "more", and this time I got the >expected behavior on both machines. > >My question: Shouldn't shell escapes redirect the input (and output) >to the terminal? > >Tom Hofmann >CIBA-GEIGY AG >Scientific Computer Center >P.O. Box Tel. +41 61 372059 >CH-4002 Basel >Switzerland uucp: ...!mcvax!cgcha!wtho I tryed this under Unix System III using "mailx" and got: No message !?! I tried it again from normal shell and hitting CTRL-D with no message body and got the same thing. Apparently: ls -a | more !mailx robertd Doesn't send ANYTHING to the message body. [> Rd -- North Coast Computer Resources(ncoast) - 216-781-6201 (or 781-6202) UUCP:decvax!cwruecmp!ncoast!robertd Sysop: NEODG (login "sbbs")