I want to change a cell in file when my desired state exists. Example:
File:
id311 vmName1 state0
id312 vmName2 state0
id313 vmName3 state0
I will type a script and this script changes the state column of just one row. So if I type sed -i 's/state0/state1/g'
all state0
's be state1
. I want to change state of only one row like:
File:
id311 vmName1 state0
id312 vmName2 state1
id313 vmName3 state0
How can I use the sed
command for a special line with use id?
note: id's are unique.