Computing.Net > Forums > Unix > find and replace stings

find and replace stings

Reply to Message Icon

Original Message
Name: Vincent Conrad
Date: September 22, 2002 at 01:15:35 Pacific
Subject: find and replace stings
OS: Unix (?)
CPU/Ram: alpaha machine (?)
Comment:

I'm writing my first ever script so I'm a bit of a novice, hopefully this problem is simple:

I need to take a number from one file, and place it in a specific location in another. I've got the script to extract the number, and intended to use something like sed to find the particular character string I want to replace with this number.

The proble is that the new string will be a number that I don't know, hence I can't just write the sed command to replace a specific character string.

I'm trying to define the replacement number as a variable that's set as an awk command:
VAR1= `awk 'NR==2 {print $1}' filename.plt`

and then use:

sed (/string/,$VAR1,/string/) but I get permission denied messages.

I can run the exact same awk command myself, but it doesn't seem to like it in the script.

Any suggestions? Should I try a whole new track?

Thanks in advance


Report Offensive Message For Removal

Response Number 1
Name: immulett
Date: September 23, 2002 at 09:19:10 Pacific
Subject: find and replace stings
Reply: (edit)

Give the files full permission by typing:

chmod 777 filename



Report Offensive Follow Up For Removal

Response Number 2
Name: Vincent
Date: September 24, 2002 at 06:18:37 Pacific
Subject: find and replace stings
Reply: (edit)

thanks immulett but it still gives me execute permission denied message.

should I try a different approach?


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: find and replace stings

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software