This question already has an answer here:
- \1 - what does this sed action mean? 1 answer
I am posting this question because I am unable to add a comment to an answer submitted by Kusalananda here: "key = value" lines: how to replace a specific key's value?
He proposed the following solution:
sed -E 's/^(power[[:blank:]]*=[[:blank:]]*).*/\1something/' TheFile
Q1: What is the meaning of "\1"?
Q2: How can I modify this when dealing with key-value pairs with quotations around the value? e.g.
--- edit ---
Q3: In trying the suggestion from RalfFriedl I discovered that the name of my variable is being inserted, not the value.
sed -E 's/^(MTU[[:blank:]]*=[[:blank:]]*).*/\1$NewMtu/' MyEthFile