back toc next

Examples

Invocation of ed

bash$ ed textfile.txt < commandfile
bash$ ed textfile.txt <<EOF
a
This is now the last line.
.
wq
EOF
Inserts a line at the end of a file (the initial position is the last line).
A single period exits from insert mode
The notation "<<string\n...\nstring": here-document of the shell