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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

find and replace stings

Reply to Message Icon

Name: Vincent Conrad
Date: September 22, 2002 at 01:15:35 Pacific
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



Sponsored Link
Ads by Google

Response Number 1
Name: immulett
Date: September 23, 2002 at 09:19:10 Pacific
Reply:

Give the files full permission by typing:

chmod 777 filename



0

Response Number 2
Name: Vincent
Date: September 24, 2002 at 06:18:37 Pacific
Reply:

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

should I try a different approach?


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


UNIX command to display c... alphabet calculation cmd



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: find and replace stings

One more Q. (find and replace) www.computing.net/answers/unix/one-more-q-find-and-replace/5826.html

Need help with a search and replace logi www.computing.net/answers/unix/need-help-with-a-search-and-replace-logi/3296.html

unix script - find and replace www.computing.net/answers/unix/unix-script-find-and-replace/5816.html