[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] dreaded spaces in file names....
- Subject: [ale] dreaded spaces in file names....
- From: dcorbin at machturtle.com (David Corbin)
- Date: Tue Jan 20 06:21:24 2004
- In-reply-to: <[email protected]>
- References: <[email protected]>
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
'mypattern'
--
David Corbin <dcorbin at machturtle.com>