Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Jul 2014 00:22:43 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Parv <parv@pair.com>
Cc:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: long string using find and "-exec ls -ls" to find part-of filename
Message-ID:  <20140701002243.2b789c3e.freebsd@edvax.de>
In-Reply-To: <20140630214506.GA1606@holstein.holy.cow>
References:  <20140630045605.GA11147@ethic.thought.org> <53B0EFF2.80205@calorieking.com> <CA%2Bg%2BBvg1=o71ObOpbh4ry-=unj2HOjjmcQHX1DOeAfwyhLu=QQ@mail.gmail.com> <20140630053004.GB16901@ethic.thought.org> <CA%2Bg%2BBvh%2BDk0iYCjbGKVt59-nfDoCFQ6qmArrJu7ueaT7VzDi1g@mail.gmail.com> <20140630064044.GA25085@ethic.thought.org> <20140630230316.44ec3257.freebsd@edvax.de> <20140630214506.GA1606@holstein.holy.cow>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 30 Jun 2014 11:45:06 -1000, Parv wrote:
> in message <20140630230316.44ec3257.freebsd@edvax.de>,
> wrote Polytropon thusly...
> >
> > On Sun, 29 Jun 2014 23:40:44 -0700, Gary Kline wrote:
> > >     ANYWAY, the thing learned tonight is that it's *XARGS* <cmd>
> > >     instead of -exec abcfubarCmd.
> >
> > Allow me to add one little reminder:
> >
> > When using xargs, usually _one_ program will be executed
> > with a command line containing _all_ results of the find
> > command. If you want to run a program on _each_ of the
> > results, this is the typical sh solution:
> >
> >       find ... | while read F; do
> >               somecommand $F
> >       done
> ...
> 
> If only one command to be run for each file, then xargs can be used
> with "-n" option to specify "the maximum number of arguments taken
> from standard input for each invocation" ...
> 
>   find ... | xargs -n 1 command ...

This works! After reading "man xargs" I have re-instantiated
my memory about this feature. Thanks for the reminder! :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140701002243.2b789c3e.freebsd>