awk , sed :
$ sed -n test.txt -e '1,3p' -e '4,$s/hello/hello/p' test.txt > $output_file
-n , , . -e - '1,3p prints ou 4,$s/hello/hello/p , hello, hello . p .
There should be a way to use it 4,$g/HELLO/p, but I could not get it to work. It has been a long time since I really messed up sed.
source
share