Weird Problem with cat

Jay Plett jay at phoenix.Princeton.EDU
Fri Nov 25 14:23:17 AEST 1988


In article <PS72234.88Nov22020044 at naakka.tut.fi>, ps72234 at naakka.tut.fi (Pertti Suomela) writes:
> In article <41 at eplrx7.UUCP> mcneill at 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 at princeton.edu



More information about the Comp.unix.wizards mailing list