PDA

View Full Version : How to pass commands to vi via textfile


hfr
10th December 2010, 15:31
Hi there,

i know this can be done as I did it three years ago, but now I can't remember how.

I want to open vi and automatically pass a textfile containing vi commands to it.

For example, here are the contents of the textfile:


^
J
k
dd

Now how can I open vi so it automatically executes the commands in that textfile?

Regards
hfr