[Eug-lug] how do I get out of this?

Mike Cherba mike.cherba at caviumnetworks.com
Thu Nov 15 12:06:43 PST 2007


Interestingly enough, ! by itself on a line in vi doesn't have the
effect of a "force" command.  It is a very different option.
!! <command> 
executes <command> and replaces the line the cursor is on with the
output.  so "!!ls"  gives you the output of ls added into your file.
But at least in my version, you can use !? where ? can be any character
and it does basically the same thing.

			-Mike

On Thu, 2007-11-15 at 13:52 -0600, Fred James wrote:
> larry price wrote:
> 
> >actually horst
> >the ! terminating the command instructs vi to quit immediately without
> >writing the file out.
> >
> >//use vi, but only when trapped.
> >
> >On Nov 15, 2007 9:53 AM, horst <horsu at freeshell.org> wrote:
> >  
> >
> >>>Date: Thu, 15 Nov 2007 01:30:12 -0800
> >>>From: larry price <laprice at gmail.com>
> >>>Subject: Re: [Eug-lug] how do I get out of this?
> >>>
> >>>type
> >>>
> >>>[esc]
> >>>:
> >>>q
> >>>!
> >>>
> >>>that's one character to a line.
> >>>      
> >>>
> >>Larry - I think emacs people shouldn't do vi posts past 1 in the morning :-)
> >>
> >>On a single line:
> >>  !
> >>doesn't mean anything (as far as I know, or you have redefined the !-key,
> >>or...)
> >>
> >>:<cmd>!
> >>means ignore warning and do it anyway!
> >>  (like  :w! :x!  as in write!  --although file was opened as read-only)
> >>  ( '<cmd>' meaning 'w' or 'x' )
> >>
> >>:!<cmd>
> >>means execute shell <cmd>
> >>
> >>
> >>Wes, BTW, my vi/vim's do provide you with a hint:
> >>  " No write since last change (add ! to override) "
> >>
> >>  - Horst
> >>    
> >>
> :w to write without quit
> :wq to write and quite
> :q to quite without write
> add the ! to either to force it (if allowed)
> Regards
> Fred James
> 
> _______________________________________________
> EUGLUG mailing list
> euglug at euglug.org
> http://www.euglug.org/mailman/listinfo/euglug
-- 
Mike Cherba
mike.cherba at caviumnetworks.com
desk phone: 541-684-3820
cell phone: 541-914-2188


More information about the EUGLUG mailing list