[Gllug] shell quoting problem

Nix nix at esperi.org.uk
Thu Jul 3 15:14:50 UTC 2008


On 2 Jul 2008, Alain Williams stated:
> I wanted to find files that had 'John Smith' as part of the name and 'ls' them.
> 	ls -l $(locate 'John Smith')
> Doesn't work since the spaces are interpretted as argument separators - as I expected.

locate -0 "John Smith" | xargs -0r ls -l

(Requires GNU findutils 4.2.4+, which you almost certainly have)
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list