![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| Replace text in multiple files | on9west | Shell Programming and Scripting | 1 | 05-20-2008 01:35 AM |
| read space filled file and replace text at specific position | COD | Shell Programming and Scripting | 6 | 04-21-2008 05:40 AM |
| Replace text in multiple files | Tonka52 | Shell Programming and Scripting | 10 | 03-24-2008 08:11 AM |
| how to replace one line in text with several lines | FunnyCats | UNIX for Dummies Questions & Answers | 1 | 01-18-2007 09:52 AM |
| jumping to a specific line in a text file | mridula | High Level Programming | 4 | 09-20-2005 01:49 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
How to replace specific text line out of multiple occurance
Hi
I would like to replace specific line eg ExitAction = NONE to ExitAction = FALSE under only TASK sipsiproc and other ExitAction = NONE will remain as usual in the file(shell script) The file contains: Code:
TASK rgcdproc {
CommandLine = $SSHOME/bin/rgcd.exe
NewConsole = yes
ExitAction = NONE
DependantProcs = megacopiproc
}
TASK sipsubsystemproc {
CommandLine = $SSHOME/bin/sipsubsystem.exe
NewConsole = yes
ExitAction = NONE
DependantProcs = sipsiproc
}
TASK sipsiproc {
CommandLine = $SSHOME/bin/sip_si.exe
NewConsole = yes
ExitAction = NONE
DependantProcs = sipsubsystemproc
}
TASK megacopiproc {
CommandLine = $SSHOME/bin/megacopi.exe
NewConsole = yes
ExitAction = NONE
DependantProcs = rgcdproc
Madhu Last edited by Yogesh Sawant; 06-17-2008 at 07:32 AM.. Reason: added code tags |
|
|||||
|
Radoulov,
Could you explain a little more on how the second perl solution works? I can't figure out how the substitute knows which "ExitAction = NONE" to substitute. I see that you're qualifying it with the if statement, but I still don't see how that makes the substitute get right "ExitAction = NONE" and not the first "ExitAction = NONE" . |
|
|||||
|
Quote:
the -00 flag+argument turns the paragraph mode on. From perldoc perlrun: Quote:
So change the ExitAction only for the record(s)/paragraph(s) that begin with the pattern "Task sipsiproc". |
![]() |
| Bookmarks |
| Tags |
| solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|