I have the below lines in a file:
SUT_INST_PIT=true SUT_INST_TICS=true SUT_INST_EXAMPLES=false SUT_INST_PING=false
How can i create a sed line to match pattern
SUT_INST_PING and set
I can't simply replace
true because I don't want to change
SUT_INST_TICS even if they are false!!!
I have at the moment two
sed commands that are working, but i would like one line only!
sed -i "s/SUT_INST_EXAMPLES=false/SUT_INST_EXAMPLES=true/g" <file> sed -i "s/SUT_INST_PING=false/SUT_INST_PING=true/g" <file>
One more thing the
sed line should be able to be parametrized to set
false, but only for
Solution (according to @RomanPerekhrest) and how to use it in send (expect script):
send "sed -i 's\/^\\(SUT_INST_EXAMPLES\\|SUT_INST_PING\\)=false\/\\1=true\/' file\r"