Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!lll-tis!ames!killer!wnp From: wnp@killer.UUCP (Wolf Paul) Newsgroups: comp.os.minix Subject: Re: Public Domain version of: yes(1) Message-ID: <3814@killer.UUCP> Date: 13 Apr 88 20:17:01 GMT References: <2797@crash.cts.com> Reply-To: wnp@killer.UUCP (Wolf Paul) Organization: The Unix(R) Connection BBS, Dallas, Tx Lines: 20 In article <2797@crash.cts.com> cline@pnet01.cts.com (Ben Humphreys) writes: >> yes | rm filenames... > >If yes's output has to complete before rm's processing is to begin, how does >yes know when to stop (forgive such a niave question please)? ^^^^ It doesn't. As soon as rm is done, it closes its end of the pipe; next time yes tries to write to the pipe (as I said, it doesn't know that rm is done), the write fails because the pipe has been closed at the reading end, and yes dies with the error message, "broken pipe" (at least on 4.2 that's the way it behaves). Also of course, yes' output does not have to complete before rm begins - this is happening concurrently. Remember, UNIX is multi-tasking :-). Yes only needs to output one line before rm can delete the first file, and so on, one line of "yes" output per deleted file. -- Wolf N. Paul * 3387 Sam Rayburn Run * Carrollton TX 75007 * (214) 306-9101 UUCP: ihnp4!killer!dcs!wnp ESL: 62832882 INTERNET: wnp@EESDES.DAS.NET or wnp@dcs.UUCP TLX: 910-280-0585 EES PLANO UD One Austrian's Opinion: Waldheim must go!