Re: [ILUG] BaSh or perl scripting q

From: Padraig Brady (padraig at domain antefacto.com)
Date: Fri 31 Aug 2001 - 12:20:23 IST


Padraig Brady wrote:

> Padraig Brady wrote:
>
>> How about:
>>
>> find /path/of/indexfile /dir/to/scan -type f | xargs cat | tr -cs
>> "[:alnum:]-" "\n" | sort | uniq -u
>
>
> Following should be better (allows ' in words and ignores case
> differences):
>
> find /path/of/indexfile /dir/to/scan -type f | xargs cat | tr -cs
> "[:alnum:]-'" "\n" | sort -f | uniq -iu
>
> Padraig

And the following should be even better :-) as it will handle the case
where there are out of date
words in the index file. I.E. words in the index file that aren't in any
other files should not be reported
according to your previous specs:

find /path/of/indexfile /path/of/indexfile /dir/to/scan -type f |
xargs cat |
tr -cs "[:alnum:]-'" "\n" |
sort -f |
uniq -iu

If you wanted to report all "out of date" words in the index you could do:

find /path/of/indexfile /dir/to/scan -type f |
xargs cat |
tr -cs "[:alnum:]-'" "\n" |
sort -f |
uniq -iu |
cat /pat/of/indexfile - |
sort -f |
uniq -iu

Padraig.



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:11:55 GMT