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!

I never knew this until I put on my Unix hat and tried it!

I discovered by chance that you could put in an environment variable into the Window's Explorer address bar and it resolves to the location - path that I typically use daily include %TNS_ADMIN%, %TEMP%, %USERPROFILE%. I only considered doing this when I became frustrated with trying to remember locations - how easy is it on Unix - cd $ORACLE_HOME.  Now, it is just as easy on Windows.



P.S. Some of my work mates said they use this all the time - doh!