$ awk '/B/{print "Replacement Text"} /B/,/C/{next} 1' "$fileName"
A
Replacement Text
D
Explanation of awk code:
/B/{print "Replacement Text"}
When we see the B line, print out the new text, whatever it is.
/B/,/C/{next}
Any any line between B and C inclusive, skip the rest of the commands and jump to the next line.
1
This is awk shorthand for print the current line.
Variable text
If the replacement text is in the shell variable newtext, then use:
awk -v new="$newtext" '/B/{print new} /B/,/C/{next} 1'
To modify the file in place
If you have GNU awk v4.1.0 or better:
$ awk -i inplace '/B/{print "Replacement Text"} /B/,/C/{next} 1' "$fileName"
With earlier versions:
awk '/B/{print "Replacement Text"} /B/,/C/{next} 1' "$filename" >tmp && mv tmp "$filename"