From: Padraig Brady (padraig at domain antefacto.com)
Date: Thu 30 Aug 2001 - 15:27:24 IST
JustinMacCarthy wrote:
>I have a file with a word per line. I have a directory containing both
>files and directories with also contain files etc .
>
>I need to get a list of words that do not appear in the files in the
>directory .
>
>grep -r -i 'word' code gives me the recursive search if the directory for a
>given word and a list of the lines its in. So I'm looking to do something
>like
>
>foreach word
> if not grep -r -i word code
> print word
> else
> continue
>
>What would the best to do this in bash / perl
>
>Thanks - and no its not home work :-)
>
How about:
find /path/of/indexfile /dir/to/scan -type f | xargs cat | tr -cs
"[:alnum:]-" "\n" | sort | uniq -u
Padraig.
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:11:54 GMT