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: Sven Mascheck
Subject: Re: How to deal with space in command line?
Date: Sun, 10 Oct 2010 23:54:48 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Sat, Oct 09, 2010 at 12:06:21AM +0200, Sven Mascheck wrote:

> find . -type f -name '*.c' -exec sh -c 'vi "$@"' find-sh {} +

PS (still offtopic): vi was not the original example, it came as
illustration.  But sh -c '' is only useful if you still have to process
the filenames somehow (which I confused). Otherwise it's simply

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

The usefulness and robustness of sh -c '' (in connection with
a loop, in case) - especially about files with spaces or
newlines - remains worth to mention, though.



reply via email to

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