Path: utzoo!attcan!uunet!husc6!rutgers!njin!princeton!phoenix!jay From: jay@phoenix.Princeton.EDU (Jay Plett) Newsgroups: comp.unix.wizards Subject: Re: Weird Problem with cat Summary: stdout closed Message-ID: <4585@phoenix.Princeton.EDU> Date: 25 Nov 88 04:23:17 GMT References: <41@eplrx7.UUCP> Organization: Princeton University, NJ Lines: 33 In article , ps72234@naakka.tut.fi (Pertti Suomela) writes: > In article <41@eplrx7.UUCP> mcneill@eplrx7.UUCP (mcneill) writes: >> eplrx7 {root} % cat ~mcneill/.login >> cat: write error bad file number > > Tcsh (I don't know if you were running it) contains a bug. > .....................................type 'echo ~legalusername' twice. > In the first time, echo won't print anything (strange?), but in the > second time it works normally. I get the same thing on a Sun 386i running a different hacked csh. Haven't bothered to track it down yet, but here's a hint that might help someone who can be bothered: the shell fires up the first command with file descriptor 1 (stdout) closed. Here's the relevant trace output from running ls twice in succession: % trace ls ~pro . . . open ("/home/pro", 0, 037367540134) = 1 . . . close (1) = 0 write (1, "admin\nbugs\ndistrib\nledger\nmail\nm".., 61) = 0 . . . % trace ls ~pro open ("/home/pro", 0, 037367540134) = 3 . . . close (3) = 0 . . . write (1, "admin bugs distri".., 108) = 108 . . . close (1) = 0 --- ...jay@princeton.edu