You could use ex, which comes with vim and is the command line tool for vim.
Eran's answer is definitely correct, but I'd personally use ex -c (vim -c is also possible):
> echo asdf > blub
> ex fileblub -c "normal a_" -c "normal l.l.l." -c wq
> cat blub
a_s_d_f_
This is my preferred way, because there are not multiple files.
If you remap escape to jj (for example), you can easily make more complicated normal statements:
ex file -c "normal a_jjl.l.l." -c wq
For your information:
- normal sends letters in normal mode to
- wq quits the program
- to send multiple commands in one string (no additional -c option), use the pipe character |. But: This does not work in the case of normal.
- This works only for 10 -c's. But for more commands, I would recommend to create a file.