[NTLUG:Discuss] scratching head

Steve Baker sjbaker1 at airmail.net
Fri Feb 28 11:45:36 CST 2003


kbrannen at gte.net wrote:
> Fred James wrote:
> 
>> Steve Baker wrote:
> 
> 
>>>>>  find . -type f | xargs file | grep -i text | cut -f1 -d: | xargs 
>>>>> grep "..."

> BTW, while I agree with Steve's point (data files with enough ASCII may 
> be shown to be "text"), he picked a bad example.  A file that's really a 
> PNG file would not be returned anyway.  Grabbing one at random off my 
> system, the file command says:
> 
> ./star.png:         PNG image data, 15 x 13, 2-bit colormap, non-interlaced

No!  You missed the point.

The filename in my example was 'texture_map.png' ... TEXTure_map.png...geddit?
The filename is listed in the output of 'file' - so the following grep picks it
up because it's looking for 'text' in *any* of the output of 'file'.

(We have spent *FAR* too much time and energy on this!)
---------------------------- Steve Baker -------------------------
HomeEmail: <sjbaker1 at airmail.net>    WorkEmail: <sjbaker at link.com>
HomePage : http://www.sjbaker.org
Projects : http://plib.sf.net    http://tuxaqfh.sf.net
            http://tuxkart.sf.net http://prettypoly.sf.net
-----BEGIN GEEK CODE BLOCK-----
GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++
-----END GEEK CODE BLOCK-----




More information about the Discuss mailing list