I'm listening to "Linux Shell Scripting - Advanced" course and couldn't make sed to make changes in range. What am I doing wrong?
cat 1
one two
two two
three two
cat 1 | sed '2{s/two/four/; s/two/five/}'
sed: 1: "2{s/two/four/; s/two/fi ...": bad flag in substitute command: '}'
Though:
cat 1 | sed -e '2s/two/four/; 2s/two/five/'
one two
four five
three two
and:
sed '2{
> s/two/four/
> s/two/five/
> }' 1
one two
four five
three two