[Vm-dev] Spaces in file names (was: renaming dprintf)

David T. Lewis lewis at mail.msen.com
Sun Aug 16 00:05:14 UTC 2009


On Sun, Aug 16, 2009 at 01:45:26AM +0200, Bert Freudenberg wrote:
> 
> On 16.08.2009, at 01:27, Eliot Miranda wrote:
> 
> >>On Sat, Aug 15, 2009 at 9:34 AM, David T. Lewis  
> >><lewis at mail.msen.com> wrote:
> >>>
> >>> My preference would be to remove spaces from the file names in the
> >>> Mac OS subtree.
> >>
> >>If you are working from a Terminal, try something like this to scan
> >>for all C source and header files that contain the string 'foobar':
> >>
> >>$ find 'Mac OS' -name '*.[ch]' -exec grep -l foobar {} \;
> >
> >If there are spaces in the filename then you need to put quotes  
> >around the file name expansion, i.e.
> >
> >$ find 'Mac OS' -name '*.[ch]' -exec grep -l foobar "{}" \;
> 
> No you don't. This is not expanded by the shell.

BTW, I was greatly surprised to find that the string 'foobar' exists only
in the "*.[ch]" files of the Mac OS tree. I'm completely at a loss to
explain this, but my sense of balance was restored by doing

  find * -name '*.[ch]' -exec grep -li fuck {} \;

which finds hits in the unix, win32, and RiscOS directories, and nothing
at all in the Mac OS tree.

;)

Dave



More information about the Vm-dev mailing list