[olug] Unix Tip: SUSPEND A VI SESSION FOR SHELL

ktb xyf at nixnotes.org
Sun Mar 16 20:08:24 UTC 2003


On Sun, Mar 16, 2003 at 11:30:05AM -0800, Unix Guru Universe wrote:
> 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 
> 			      UNIX GURU UNIVERSE 
> 			         UNIX HOT TIP
> 
> 			Unix Tip 1901 - March 16, 2003
> 
> 		    http://www.ugu.com/sui/ugu/show?tip.today
> 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 
> 
> SUSPEND A VI SESSION FOR SHELL
> 
> Ever want to run some shell commands while doing a vi edit
> session? Like, "what's the name of that file" I want to use in
> this script I'm making?
> 
> Instead of exiting vi; doing the ls filenamepart*, and going
> back into vi, you can from  a vi session:
> 
> enter ":", then enter "shell".
> 
> This suspends the vi session and gives you a command prompt
> where you can use any shell command. When finished, enter the
> "exit" command and you will be returned to the vi session. 
> 
> 
> This tip generously supported by: cwhenske at gatx.com

You can also run shell commands from within vi.  For example if you're
creating a script and want to include "ls" but can't remember the full
pathname, enter command mode and -

:!which ls

This will display the full path to "ls" and you will be prompted to
"[Hit return to continue]"

kent

-- 
To know the truth is to distort the Universe.
                      Alfred N. Whitehead (adaptation)


More information about the OLUG mailing list