There are many lines in a text file and I would like to change the value true to false using a one line script.
bash-3.2$ grep online test.txt
# online = false --> ONE SHOT import (delete all table contents before importing)
# online = true --> DIFFERENTIAL import (import without clean the table contents)
online = true
I tried this
sed -i.bak '/DIFFERENTIAL\|/ONE SHOT\/!s/online.*/online = false/g'
but it gave this error:
sed: -e expression #1, char 17: unknown command: `O'
I don't want the first 2 lines to change, only the third online = true to become online = false. It can be anywhere in the file but it will match online =. So I would want my command to ignore 1 and 2 and change 3 only.
\|/ONE SHOT: looks like you have an extra slash in there.