[clue-tech] question on commands

David Anselmi anselmi at anselmi.us
Fri Mar 11 18:39:08 MST 2005


Ski Dawg wrote:
> On Thu, 2005-03-10 at 18:25 -0700, David Anselmi wrote:
> 
>>$ find -name filename -exec vi {} \;
[...]
> If I am understanding this correctly, I don't think this is quite right,
> at least when using vim, instead of classic vi. When using vim with the
> -exec of find, it will open one instance of vim and put each found file
> into a different buffer. You can then use :bn (next buffer), :bp
> (previous buffer) and :bd (close current buffer) to navigate through the
> different files that were found.

That seems unlikely.  Hmmm.

When find runs vi it runs it with one file name as an argument.  Look at 
ps -f and you'll see.  So it isn't really possible for vim to guess what 
the other files will be.  When the first vim exits, find starts up the 
next, again with one file.

Seems like you may be using gvim.  If it detaches from the find process, 
find might take that as an exit and run the next gvim.  If gvim is run 
when it's already running it may signal the first to open the next file 
in a new buffer but the same window.

What does find do when you run like that, return immediately or after 
you close vim?  What does ps -af say?

Dave



More information about the clue-tech mailing list