Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!husc6!uwvax!pfeiffer From: pfeiffer@rsch.WISC.EDU (Phil Pfeiffer) Newsgroups: net.unix-wizards Subject: Repeat of a question posted to net.unix (resp: shell processing) Message-ID: <2729@rsch.WISC.EDU> Date: Wed, 17-Sep-86 15:03:40 EDT Article-I.D.: rsch.2729 Posted: Wed Sep 17 15:03:40 1986 Date-Received: Fri, 19-Sep-86 22:15:45 EDT Distribution: na Organization: U of Wisconsin CS Dept Lines: 45 Thought I'd post this request for info on how background shell jobs, programs, and stdin/stdout interact on net.unix-wizards, because of the lack of response from readers of net.unix. The systems in question are 4.3BSD Unix and Ultrix. The problem is as follows: Assume that file "nxf" does not exist. Assume that the following lines are in shell script 'cmd': #!/bin/csh rm nxf >& cmd_out echo $status > cmd_stat Assume the following lines are in shell script 'master': #!( doesn't matter whether the csi is "/bin/sh" or "/bin/csh" ) cmd 'master' executes just fine. The "cannot find file" error message and error status values are written into cmd_out and cmd_stat, respectively. (the "cmd_stat" file contains a "1"). However, assume the following lines are in shell script 'bgmaster': #!( doesn't matter whether the csi is "/bin/sh" or "/bin/csh" ) cmd & wait Now, if 'bgmaster' is executed, "cmd_out" is empty on return, and "cmd_stat" contains the single line, "0". Why? Have I failed to understand something obvious about shell background processing? -- -- Phil Pfeiffer ...!{harvard,ihnp4,seismo,topaz}!uwvax!pfeiffer (608) 263-7308