I'd like to write a bash script that essentially automates this process:
vi filename.pdf
(open "filename.pdf" using vi)
:4,7d
(in vi command mode, delete lines 4-7)
O
(in vi command mode, tap shift+O (captial oh) to create new line)
<<>>
(in vi insert mode, type two lesser-thans and two greater-thans)
ESC
(switch vi to command mode)
:wq
(in vi command mode, save file and quit vi)
echo "Complete."
sed -i '4,7c\<<>>' filename.pdf
– Costas Nov 11 '16 at 18:53