slight problem with grep.

Cameron Carson ccc at bu-cs.UUCP
Wed Feb 5 02:20:11 AEST 1986


>In article <9299 at ritcv.UUCP> jxs7451 at ritcv.UUCP () writes:
>>What happened is I used grep like this to find all of them.
>>
>>	grep write * > zzzz
>>
>>having zzzz being a random file.
>
>Note that this will only happen if 'zzzz' is an existing file.  If
>either of the following situations occur, there won't be a problem:
>	grep write * > AAAA		<- AAAA doesn't contain 'write'
>	rm zzzz ; grep write * > zzzz
>
>In the first situation, the file 'AAAA' is searched first.
>In the second situation, the '*' doesn't match the file 'zzzz',
>so grep never even opens it.

Hmmm...I had the same experience as jxs7451 at ritcv:  in the 4bsd csh's
I've used, the shell takes care of creating stdout before it does
file name expansion, resulting in '*' matching 'zzzz' even if it
didn't exist previously.

-- 
Cameron C. Carson
Distributed Systems Group
Boston University ACC

UUCP: ...!harvard!bu-cs!ccc
ARPA:  ccc%bu-cs at csnet-relay.arpa



More information about the Comp.bugs.4bsd.ucb-fixes mailing list