scripts in vi

G.D.Thurman plug-discuss@lists.plug.phoenix.az.us
Thu, 27 Jun 2002 10:11:53 -0700 (MST)


On Thu, 27 Jun 2002, Greg wrote:

> For example a script that would insert a date into a document.
>
+ Press ESC (i.e. make sure 'vi' is not in an insert-mode)
+ Go to the spot in your file where you want to insert
  the output of a command.
+ Execute the command using the 'r'ead command as follows...

:r !date

Example:

I'm using 'vi' right now at
Thu Jun 27 10:08:49 MST 2002

---

What is  :r !date   ?

Enter into colon  :  mode (also know as 'ed' mode)
and execute the 'r'ead command followed by ! and
then a command-line.