All is in the title :
here is the string pattern of a multi-line file:
foo_bar_alpha = "a1b2c3_cat_andthis"
barfoo_bar_alpha = "just a int number"
loremfoo_bar_beta = "192.168.0.0"
... other lines come here ...
Using sed (and/or awk and/or perl), I need to substitute char “_” with “.” , but only in the first part of the string, which is right delimited by “=”, and keep the 2nd part (after “=”).
Sthg like :
sed "s/(.*)=(.*)/ \1 with "_" replaced by "." = \2/g" < my_file
¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨
how to do that ?
Thx in adv.
Input
Output
*Note: If you for sure need to delimit on
=because your variable names somehow contain spaces (highly doubtful) then this works: