Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Redirection from script

10 views
Skip to first unread message

Charlie Roberts

unread,
Apr 2, 2015, 9:42:55 AM4/2/15
to


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

unread,
Jul 26, 2015, 11:29:54 AM7/26/15
to
Am Thu, 02 Apr 2015 09:43:45 -0400 schrieb 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
0 new messages