![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Question On Command in Variable | scotbuff | Shell Programming and Scripting | 4 | 10-29-2007 08:23 PM |
| How to Store command O/P to a variable... | smartbuddy | UNIX for Dummies Questions & Answers | 7 | 08-24-2007 08:49 AM |
| set variable command | ammu | Shell Programming and Scripting | 1 | 05-24-2007 10:45 AM |
| Export command giving Variable Name vs the Value set for the Variable | ParNone | UNIX for Dummies Questions & Answers | 2 | 04-03-2006 12:43 PM |
| Command output to a variable. | videsh77 | Shell Programming and Scripting | 8 | 12-16-2004 06:06 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Need a sed command that uses variable
Hi ,
Seen some of wonderful posts. Please have look at my problem. I have a text file ketkee.txt , which look like below. GATES := apple mango banana XMLCHECK := red blue green pink My requiement is to find the line that has XMLCHECK in it. and append two variables followed by a space to all red blue green pink. so that it look like red_11 blue_11 green_11 pink_11 i tried the following script DELIM="_" RELCODE=11 tag=`grep XMLCHECK ketkee.txt | tr -s ' " " ' | sed 's/"XMLCHECK :="//g' | sed 's/[" "]/"$DELIM$RELCODE "/g' But it is not working fine as it does not take value of the variables.if i replace variables with number like (sed 's/[" "]/_11 /g' ) it is working fine. But my i need to do this with the help of variables. Please help me out with this. Thanks Ketkee |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|