How to pass commands to vi via textfile

Discussion in 'Technical' started by hfr, Dec 10, 2010.

  1. hfr

    hfr Member

    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:

    Code:
    ^ 
    J
    k
    dd
    Now how can I open vi so it automatically executes the commands in that textfile?

    Regards
    hfr
     

Share This Page