The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 01-31-2008
digobh digobh is offline
Registered User
 

Join Date: Jan 2008
Posts: 3
Looping and using Sed

Hi guys

I having som problem trying to use sed to get a file and insert inside another one. I'll try to explain better.

I have a base.txt and using sed(having a array variables) I'm chaging some strings inside this file and saving as base1.txt. until here okay.
Then, I have to get this base1.txt and insert it inside another file called script.txt.
Well, If I didn't have any looping so far so good. Then, when the script restart, it has to change the base file again, with a different variable(until here okay), and then get this base1.txt again and insert at the same old file script.txt.

The problem is, Sed cleans out the file when I overwrite it. I tried to rename files, but I just can't reach the logic of doing this...
Any suggestion would be a lot appreciatted.

Thank you in advance.

Rodrigo Guimaraes
Reply With Quote
Remove advertisements
!!
Forum Sponsor