bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to deal with space in command line?


From: Greg Wooledge
Subject: Re: How to deal with space in command line?
Date: Mon, 11 Oct 2010 08:12:23 -0400
User-agent: Mutt/1.4.2.3i

On Sat, Oct 09, 2010 at 12:06:21AM +0200, Sven Mascheck wrote:
> On Mon, Sep 20, 2010 at 09:14:15AM -0400, Greg Wooledge wrote:
> > unset array
> > while IFS= read -r -d '' f; do array+=("$f"); done \
> >   < <(find . -name '*.c' -print0)
> > vi "address@hidden"

> As you mention -exec yourself, what about simply
> 
> find . -type f -name '*.c' -exec sh -c 'vi "$@"' find-sh {} +

> find . -type f -name '*.c' -exec vi {} +

If there is an absolute requirement to put *all* the files on a single
command, "-exec +" may fail to satisfy it.  It might break up the files
into groups.

If it's acceptable to process the files in groups (i.e. if the example
were something that isn't vi) then "-exec +" is a great alternative.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]