Register
It is currently Wed Nov 26, 2014 8:46 pm

find / while / vi


All times are UTC - 6 hours


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 PostPosted: Wed Jan 14, 2009 11:21 am   

Joined: Fri Dec 05, 2008 11:01 am
Posts: 6
Hi.

I would like to "step through" a list of files and edit them, one at a time, if they match a name specification. Here is the command I was hoping would do the trick...

find -iname "*S*sendmail*" | while read a; do vi $a; done

...but vim only shows me the first file and gives me the following messages:

Vim: Warning: Input is not from a terminal
<contents of first file shown here>
Vim: Error reading input, exiting...
Vim: Finished.

Is there some way to accomplish what I seek to do?

Thanks!
John


Top
 Profile  
 PostPosted: Wed Jan 14, 2009 10:38 pm   

Joined: Wed Jan 14, 2009 10:22 pm
Posts: 1
vim `find "*S*sendmail*"`

Within vim, use :args *S*sendmail*


Top
 Profile  
 PostPosted: Fri Jan 16, 2009 8:40 am   

Joined: Fri Dec 05, 2008 11:01 am
Posts: 6
Thanks!

Um, once in vim with all the files open how do I close the current one and step to the next?


Top
 Profile  
 PostPosted: Mon Jan 19, 2009 5:18 am   
Moderator
User avatar

Joined: Thu Oct 11, 2007 7:12 am
Posts: 229
Location: London - UK
jfitzpat wrote:
Thanks!

Um, once in vim with all the files open how do I close the current one and step to the next?


you can use the following to move to the next file;

:next

This type of information about how to use commands are available in man pages (manuals),
using the following command;

man vim


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP