RE: du

[prev] [thread] [next] [lurker] [Date index for 2005/09/30]

From: David King
Subject: RE: du
Date: 16:58 on 30 Sep 2005
>> Because, of course, the above line will result in crap you 
>> don't want if you don't happen to have directories that
>> match your strings:
>     shopt -s nullglob
> At least in a vaguely contemporary bash.

This, of course, results in commands responding as if you typed nothing
where a wildcard doesn't match. So 
	ls -l *.o
results in a directory listing instead of a slightly more helpful
	ls: *.o: No such file or directory

Or
	cat *.c|grep func_name
waiting on stdin for you. Which is probably worse than the wildcard crap
lying around.

zsh has a "setopt NOMATCH" which prevents the command from running at all in
this case:
	cat *.c|grep func_name
	zsh: no matches found: *.c
but this has the annoying effect of
	find src -name *.h
never working like you want (since if there are .h files, they are expanded.
If there aren't, it refuses to run). And
	ls *.c *.h *.o
fails unless you have all three. And if I knew what was there, I wouldn't be
listing for them.

There's stuff above here

Generated at 16:00 on 04 Oct 2005 by mariachi 0.52