I have text file, and in it has a block that has pattern like below:
# cat file
Jit .... enabled=false
Jit ..shoes.. From=2021-01-01
Jit ..gloves.. From=2021-01-01
so I want to change all of these matching regex, wrote a sed file with these lines.
# cat sedfile
/^Jit/ {
s/enabled=false/enabled=true/g
s/From=\d+-\d+-\d+/From=2021-02-01/g
}
Pattern /^Jit/ greps lines only starting with Jit and other steps do substitutions.
Date can be anything, so I can't hardcode these, therefore matching a pattern is required.
Desired Ouput:
Jit .... enabled=false
Jit ..shoes.. From=2021-01-01
Jit ..gloves.. From=2021-01-01