On Tue, 14 Feb 2006, Ray Lai wrote:
> On Tue, Feb 14, 2006 at 11:39:45AM +0100, Otto Moerbeek wrote:
> > On Tue, 14 Feb 2006, Michael Schmidt wrote:
> >
> > > Matthias Kilian wrote:
> > >
> > > > And watch out for silly file names containing whitespace.
> > > >
> > > > BTW: if this is a contest on creative use of find(1) and other
> > > > standard tools:
> > > >
> > > > $ find . -type f | sed '[EMAIL PROTECTED]@grep -l -- foo @' | sh
> > > >
> > > > Yes, this isn't robust against whitespace, either PLUS it's
> > > > inefficient. But in some cases the find ... | sed ... | sh pattern
> > > > is quite useful.
> > > >
> > >
> > > Sometime ago I have had the same problem with spaces in filenames and
> > > dealing
> > > with them as xargs parameters. There I have used (here only as an
> > > example):
> > >
> > > find . -print | grep -i ' ' | xargs -I {} ls -ald {}
> > >
> > > FYI, that has been on a non-OpenBSD system.
> > > I4m not at my OpenBSD system at the moment, so I can4t check whether
> > > OpenBSD
> > > xargs supports the shown options. Maybe someone may test it.
> > >
> > > One may check this at a directory with space-containing filenames.
> > > Without the "-I {}" and "{}" parts you get funny output.
> > >
> >
> > Well, -print0 in find and xargs -0 are designed to deal with that.
> > Sadly these are not in POSIX (which is not documented correctly in the
> > xargs case).
>
> Does this diff fix it? (I also added a comma after the last -R.)
I already committed a similar diff,
-Otto
>
> -Ray-
>
> Index: xargs.1
> ===================================================================
> RCS file: /cvs/src/usr.bin/xargs/xargs.1,v
> retrieving revision 1.15
> diff -u -r1.15 xargs.1
> --- xargs.1 12 Sep 2005 09:44:59 -0000 1.15
> +++ xargs.1 14 Feb 2006 13:37:48 -0000
> @@ -316,7 +316,8 @@
> .St -p1003.2
> compliant.
> The
> -.Fl J , o , P , R
> +.Fl 0 , J , o , P ,
> +.Fl R ,
> and
> .Fl r
> options are non-standard