Computing.Net > Forums > Unix > using parameters in sed???

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.

using parameters in sed???

Reply to Message Icon

Name: hernandez
Date: November 21, 2003 at 01:50:27 Pacific
OS: xp / korn shell
CPU/Ram: 196
Comment:

Hi,
Anyone know a way to use parameters in a sed or a way round it??
I'm trying to do something like this:

sed 's/${USER}/${NEW_USER}/g'

but it does nothing at all...
i'm running this in the korn shell



Sponsored Link
Ads by Google

Response Number 1
Name: James Boothe
Date: November 21, 2003 at 11:38:51 Pacific
Reply:

Single quotes are keeping the shell from interpreting your variables.

Change those to double-quotes and it will work.


0

Response Number 2
Name: hernandez
Date: November 23, 2003 at 04:04:49 Pacific
Reply:

excellent - thanks


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Combination of gunzip and... changing directories



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: using parameters in sed???

parameters in sed www.computing.net/answers/unix/parameters-in-sed/6942.html

How to use if/else logic in sed/awk www.computing.net/answers/unix/how-to-use-ifelse-logic-in-sedawk/6207.html

file attachments using mail in shells scripts on unix www.computing.net/answers/unix/file-attachments-using-mail-in-shells-scripts-on-unix/1061.html