ed

Classic UNIX line editor for basic text file editing

brewmacoslinux
Try with needOr install directly
Source

About

Classic UNIX line editor

Commands

ed

Examples

Open a file for editing$ ed myfile.txt
Append text to a file non-interactively$ echo -e 'a\nHello World\n.\nw' | ed myfile.txt
Substitute text in a file using ed script$ echo -e '1,$s/old/new/g\nw' | ed myfile.txt