![]() |
|
|
grep unix.com with google
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Our Members | 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. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Interesting question - Search and replace the word after sign "="
Hi Guys,
Req your help in searching and replacing the word that comes after equals(=) symbol I would like to replace the sting in bold with a string in variable. d=ABCDF8C44C22 # grep -i NIM_MASTERID ${_NIMINFO} export NIM_MASTERID=00CDF8C44C00 I'm looking to replace any word that comes after "=" symbol in the above grep statement output. like to see the output as export NIM_MASTERID=ABCDF8C44C22 after replacing export NIM_MASTERID=00CDF8C44C00 Thanks |
|
|||
|
Code:
d=ABCDF8C44C22
# grep -i NIM_MASTERID ${_NIMINFO}|sed "s/=.*/=$d/"
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sed: a "replace unless match" question | Bubnoff | Shell Programming and Scripting | 0 | 08-17-2009 10:34 PM |
| Additional question to "awk to replace particular field" | VGR | Shell Programming and Scripting | 1 | 06-18-2009 11:05 AM |
| A question/problem about oracle "tns listener" and "enterprise manager" | talipk | UNIX for Advanced & Expert Users | 1 | 12-03-2008 07:55 AM |
| A question/problem about oracle "tns listener" and "enterprise manager" | talipk | UNIX and Linux Applications | 0 | 12-01-2008 03:08 PM |
| replace word with using "sed" not work... | happyv | Shell Programming and Scripting | 28 | 03-01-2007 03:10 AM |