Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!oddjob!gargoyle!ihnp4!laidbak!katzung From: katzung@laidbak.UUCP (Brian Katzung) Newsgroups: comp.unix.questions Subject: Re: C-shell idiosyncracy ?? Message-ID: <1248@laidbak.UUCP> Date: Sat, 14-Nov-87 00:35:15 EST Article-I.D.: laidbak.1248 Posted: Sat Nov 14 00:35:15 1987 Date-Received: Mon, 16-Nov-87 05:14:34 EST References: <33414@sun.uucp> <9316@mimsy.UUCP> Reply-To: katzung@laidbak.UUCP (Brian Katzung) Organization: Lachman Associates, Inc., Naperville, Illinois Lines: 23 In article <9316@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: >In article <33414@sun.uucp> vipin%samsun@Sun.COM (Vipin Samar) writes: ... >>So, for some reasons I just cannot pipe the output of "jobs". >To see why this happens, consider how pipes are implemented. >After creating a pipe, it is necessary to fork. It is necessary to fork to create the read end of the pipe, but not for the write end of the pipe (and the write end of the pipe is the supplier of jobs information). It is just as easy to write to the file descriptor for a pipe as it is to write to the file descriptor for a file. His shell and the several I just tested are broken because they chose to take the lazy approach by forking instead of juggling file descriptors in the current shell. IT CAN BE DONE RIGHT, and from the responses, I gather the HPUX people did do it right. Actually, in a degenerate case, you could pipe from one built-in to another, as long as you didn't ever send more than 4K before you read it (ie, "history -hr 8 | source -h" would append your last 8 events in reverse order onto your history list if source accepted input from the standard input). -- Brian Katzung ihnp4!laidbak!katzung