vi editor

Michael P. Brininstool mikepb at
Wed Jul 12 18:48:20 UTC 2006

I always did !!cmd to replace current line with output of cmd (notice no
':'), or :3,5!!cmd to replace lines 3-5 with output of cmd. 

-----Original Message-----
From: fedora-list-bounces at [mailto:fedora-list-bounces at]
On Behalf Of Les Mikesell
Sent: Monday, June 26, 2006 9:28 AM
To: For users of Fedora Core releases
Subject: Re: vi editor

On Mon, 2006-06-26 at 16:43 +0800, Ed Greshko wrote:
> > 
> > Inside vi editor when I am in command mode
> > 
> > For Example : If I want to know the hostname or pwd command How do i 
> > execute inside the Vi Editor while editing a file in command mode
> Type...
> :!pwd   or any other shell command

Or, if you would like the output of that command inserted into your text,

:r !pwd

or any other command.  Oddly, that space before the ! is important.

  Les Mikesell
   lesmikesell at

fedora-list mailing list
fedora-list at
To unsubscribe:

More information about the users mailing list