[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] dreaded spaces in file names....

On Monday 19 January 2004 21:55, John Wells wrote:
> I have a large drive that I run Win4Lin on this drive, which means I have
> a large number of windows files that have spaces in either the file name
> or one of the containing directories.
> I often have to search the drive and look for certain patterns in certain
> files.  So, a typical search might look like this:
> locate txt | grep '\.txt$' | xargs grep 'mypattern'

I haven't tested it, but here's what I'd try:

 locate txt | grep '\.txt$' | sed -e 's/^/"/' -e 's/$/"/' | xargs grep 

David Corbin <dcorbin at machturtle.com>