LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-23-2005, 07:20 AM   #1
netchtech
LQ Newbie
 
Registered: Nov 2005
Posts: 2

Rep: Reputation: 0
Edit multiple files in VI


Hi guys,

I am working as a sys engineer on AIX and need to edit some files. At the moment we are setting up multiple Oracle instances and I have created some scripts for doing this. What I would like to do is to be able to edit the db name in four different files at the same time with same information, instead of modifying every script by itself. How can I do this? I am sure it can be done in VI but I am open for any suggestions you have. What I do is a :%s/XXX/YYY/g in VI.

Please help me with a sweet hack.
 
Old 11-23-2005, 07:41 AM   #2
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
I don't know for AIX' sed, but with Linux' sed command, the -i option permits to do changes inline. Eg:

find . -type f -exec sed -i 's/mailto:me@here\.com/mailto:me@there.com/g' '{}' \;

Yves.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vi to edit files?? Andknig Linux - Newbie 2 04-22-2005 04:18 AM
how do i edit files???? zexter Mandriva 9 11-06-2004 10:02 AM
Edit files help flira Linux - Newbie 2 05-27-2004 09:31 PM
Help I need help tarring multiple files in multiple directories VisionZ Linux - Newbie 28 03-25-2004 05:25 PM
KDE Menu Edit for multiple users ethidium Linux - Software 1 09-17-2003 08:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration