Hi,
I have a following text file called my.config:
Code:
Section "General"
TYPE = $TYPE
PATH =
EndSection
How can I use sed to directly change the last parameter (string) on each line (specifically).
I have managed (tried) to this so far:
sed '/General/,/EndSection/{n; /TYPE/s/????/hej/}' myconfig
But I just can't get it to work. Please not that "????" is not actually what I put in bash. I just don't know what to put there and also it only works for the first line in the section.
The result I want is:
Code:
Section "General"
TYPE = ALL
PATH = /tmp/
EndSection
OR
Code:
Section "General"
TYPE = Generic
PATH =
EndSection
Any idea?
Thanks.
Indy