Quote:
Originally Posted by kahuna
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" .
|
Sure,
the -00 flag+argument turns the paragraph mode on.
From perldoc perlrun:
Quote:
Switches include:
-0[octal/hexadecimal]
specifies the input record separator ($/) as an octal or hexadeci-
mal number. If there are no digits, the null character is the
separator.
[...]
The special value 00 will cause Perl to slurp files in paragraph
mode. The value 0777 will cause Perl to slurp files whole because
there is no legal byte with that value.
|
In this mode each record is a paragraph of text terminated by one or more empty lines.
So change the ExitAction only for the record(s)/paragraph(s) that begin with the pattern "Task sipsiproc".