About Me

My photo
Software Developer and ideas man!

Sunday, February 19, 2012

Hmmm - vi being a little bit handy!

Just discovered the "!!" and its usage in vi.  Very handy and much easier to use than redirecting output to a text file.  Effectively, if you type "!!" in command mode, it executes the current line as input and inserts the command output in the file.  For example, if I press "!" twice on the keyboard and then type "hostname" at the prompt, the hostname of the machine will be inserted in the file I'm editing. Very nice!

No comments:

Post a Comment