Discussion:
Redirection from script
(too old to reply)
Charlie Roberts
2015-04-02 13:43:45 UTC
Permalink
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
Ralf S. Hellersen
2015-07-26 15:29:53 UTC
Permalink
Post by Charlie Roberts
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
I found a way to fill such a file with data:
grep -r Verzeichnis ./ 2> no_cxd 1>&2
After this the file no_cxd contains amount of characters.
This is of course not what you need right now, but
perhaps you can fix this command youself now.

Regards
Ralf

Loading...