[NTLUG:Discuss] scratching head
Fred James
fredjame at concentric.net
Thu Feb 27 19:08:15 CST 2003
Chris Cox wrote:
> Steve Baker wrote:
>
>> Carl Haddick wrote:
>>
>>> In other words, type all lines in all text files that contain at least
>>> three arbitrary characters, skipping lines that are 0, 1, or 2
>>> characters in length.
>>>
>>> Did I get it right? Do I win anything?
>>
>>
>>
>> That's certainly what it does...the question is why? - and why is it in
>> someones .sig ?
>>
>>>> find . -type f | xargs file | grep -i text | cut -f1 -d: | xargs
>>>> grep "..."
>>>
>
> Ok guys... this simple one line is used to find a piece of text
> in all text files within a directory.
>
> The "..." is mere elipses... you fill in the string you are looking for.
>
> I know this is the correct answer, because most people know this
> is one of my favorite one liners.
>
>>
>>
>> ...and if that's what it does, it's got a bug in it. Suppose I have
>> file called:
>>
>> texture_map.png
>>
>> ...well, let's just say it's not going to be a pretty sight!
>
>
> Uh... ok. But I think you're saying that because you assumed the
> elipses was a literal grep '...', a valid misunderstanding.
>
>
> _______________________________________________
> https://ntlug.org/mailman/listinfo/discuss
>
>
No, I think that is a valid point - "grep -i text" is going to grab all
from "xargs file" that contain that string (regardless of case), and
that would include "texture_map.png" if it exists, would it not?
--
(new signature line omitted, awaiting approval of author)
More information about the Discuss
mailing list