Xref: utzoo comp.unix.questions:5835 comp.unix.wizards:6712 Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!hao!boulder!sunybcs!ugfailau From: ugfailau@sunybcs.uucp (Fai Lau) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: Weird things in csh (and kernel?) Message-ID: <8849@sunybcs.UUCP> Date: 26 Feb 88 23:49:24 GMT References: <1193@ark.cs.vu.nl> Sender: nobody@sunybcs.UUCP Reply-To: ugfailau@joey.UUCP (Fai Lau) Organization: SUNY/Buffalo Computer Science Lines: 40 In article <1193@ark.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes: >Has anyone noticed the following oddities? >1) > % a.out < a.out > a.out: Text file busy. > % > This is not as bad as this, cat file | grep john > file There will be nothing withsoever in file "file". UNIX is kinds strange when you put the same file name at both "ends" of a pipeline or redirect. Aviod doing it or sooner or later you'll find out some files you're working on would be strangely deleted against your wish. Speaking from experience here. >Why shouldn't a process be able to read its text file? >2) > % cat ~/.cshrc > echo echo hello > % cp /bin/echo . > % ./echo > echo > hello: Command not found. > % cat echo > echo hello > hello > % > Find the source code echo.c, compile it, put the executable in you directory, and the problem would go away. The only explanation I can give for the phenomonen is that for some reason csh wants to parse .cshrc, and somehow thinks hello is a command. I'm using tcsh in /usr/local/bin and I got the error message "/bin/tcsh: not found" until I restarted with csh did I got the behavior you described. Fai Lau SUNY at Buffalo (The Arctic Wonderland) UU: ..{rutgers,ames}!sunybcs!ugfailau BI: ugfailau@sunybcs INT: ugfailau@joey.cs.buffalo.EDU