0

I need to recognize the following pattern via sed:

Fuel Side {
    dirichlet {
        t = 299
        V =  0.6

And replace the value for t and v. I tried sed /Fuel Side { dirichlet { t=/s/valuehere/ but I know that I'm going in the wrong direction because I don't really know how to recognize a complicated pattern like this. I found something like this 's/(pattern)[^=]*$/foo/' with extended regular expressions but I couldn't find any explanation for [^=]*$/.

dbugger
  • 15,868
  • 9
  • 31
  • 33
Tuni
  • 129
  • 1
  • 9
  • `[^=]*$` means 0 or more non `=` characters before the end of the line. It is entirely useless for what you are trying to do. More likely if would be useful for you to look up multiline matching with sed. – 123 Jul 06 '16 at 13:39
  • So if i do sed "s/Fuel Side,t = [0,9]/$number/g" I can replace everything behind the t with $number? – Tuni Jul 06 '16 at 14:59

0 Answers0