Redirection from script

From: Charlie Roberts (crober...)



I am running bash in Cygwin on a PC.

I am trying to find which directories (which are within a directory
that only contains directories) do *not* contain a certain type
of file. All these files have a '.cxd' extension. The simple
command line script I wrote was


touch no_cxd
for d in * ; do
ls $d/*cxd | grep cannot >> no_cxd
done


While this does cough up output when it hits directories
that do not contain a *cxd file, the redirection does not
work. 'no_cxd' is always empty.

Any explanations would be greatly appreciated.

I do not need anything more sophisticated. I can trim
the unwanted parts of the output is no time using good,
old 'vi'!

tia
cr

Share |