Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site callan.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!genrad!panda!talcott!harvard!seismo!umcp-cs!gymble!lll-crg!dual!callan!tim From: tim@callan.UUCP (Tim Smith) Newsgroups: net.unix-wizards Subject: bug in sh? Message-ID: <309@callan.UUCP> Date: Tue, 5-Mar-85 15:29:16 EST Article-I.D.: callan.309 Posted: Tue Mar 5 15:29:16 1985 Date-Received: Sun, 10-Mar-85 05:50:37 EST Reply-To: tim@callan.UUCP (Tim Smith) Organization: Callan Data Systems, Westlake Village, CA Lines: 31 Summary: Both at callan, on System V, and at cithep, using the System III sh, the following shell scripts do not behave as I would expect: Script 1 Script 2 foo=bar foo=bar echo $foo echo $foo for i in x for i in x do do echo $foo echo $foo foo=spam foo=spam echo $foo echo $foo done done < /dev/null echo $foo echo $foo When run, here is the output: Script 1 Script 2 $ sh script1 $ sh script2 bar bar bar bar spam spam spam bar $ $ script1 produces the output I would expect. Is this a bug? Or am I missing something? -- Duty Now for the Future Tim Smith ihnp4!wlbr!callan!tim or ihnp4!cithep!tim