The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
Perl: Search for string on line then search and replace text Crypto Shell Programming and Scripting 4 01-04-2008 10:24 AM
Search and Replace in Ksh DeepakXavier Shell Programming and Scripting 9 05-28-2007 09:11 AM
Search/Replace with Sed mvalonso UNIX for Dummies Questions & Answers 5 05-08-2006 08:30 PM
Search and replace sed or tr bridgeje Shell Programming and Scripting 6 10-28-2003 07:54 AM
search and Replace mukeshannamalai UNIX for Advanced & Expert Users 4 09-14-2001 07:21 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 09-15-2008
sanyerra sanyerra is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 5
Smile Search and replace

Hi All,

Suppose I have a file "a.doc"

It's contents are :

mos44.0 )

.....
......
.....


export TKTS_RELEASE=tkts44.0b7
......
.......


Now , I need to first search for the pattern "mos44.0 )" and then TKTS_RELEASE will be some 30 lines below(not 30 always)...

I need to go there and then modify the value of TKTS_RELEASE variable from tkts44.0b7 to tkts44.0b10.

For modifying the contents I can use sed command ...But how do I determine where the changes shud be done...The place where I change shud satisfy two conditions ...1) "mos44.0 )" and then some lines below..TKTS_RELEASE variable..

Kindly advice...Thanking in advance....
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:42 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0