How to use external unix command

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use external unix command

henrik-10
Hi Vimmers,

how it is possible to write the date in a file using the external unix
command (date)????


Thankful for some hints ,
Henrik

Reply | Threaded
Open this post in threaded view
|

Re: How to use external unix command

Fritz Mehner
Henrik schrieb:

>Hi Vimmers,
>
>how it is possible to write the date in a file using the external unix
>command (date)????
>
>
>Thankful for some hints ,
>Henrik
>
>
>  
:r!date

or date with options (see "man date" )

:r!date +%d-%m-%Y

Fritz
Reply | Threaded
Open this post in threaded view
|

Re: How to use external unix command

henrik-10
Thanks a lot that is exactly what i needed :)

Henrik

On Tue, 2005-06-28 at 08:46 +0200, Fritz Mehner wrote:

> Henrik schrieb:
> >Hi Vimmers,
> >
> >how it is possible to write the date in a file using the external unix
> >command (date)????
> >
> >
> >Thankful for some hints ,
> >Henrik
> >
> >
> >  
> :r!date
>
> or date with options (see "man date" )
>
> :r!date +%d-%m-%Y
>
> Fritz

Reply | Threaded
Open this post in threaded view
|

Re: How to use external unix command

Varun Gupta
Hi All

How do we in general (not any specific command ), use
the shell commands from VIM ??


Best Regards
Varun

--- Henrik <[hidden email]>
wrote:

> Thanks a lot that is exactly what i needed :)
>
> Henrik
>
> On Tue, 2005-06-28 at 08:46 +0200, Fritz Mehner
> wrote:
> > Henrik schrieb:
> > >Hi Vimmers,
> > >
> > >how it is possible to write the date in a file
> using the external unix
> > >command (date)????
> > >
> > >
> > >Thankful for some hints ,
> > >Henrik
> > >
> > >
> > >  
> > :r!date
> >
> > or date with options (see "man date" )
> >
> > :r!date +%d-%m-%Y
> >
> > Fritz
>
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
Reply | Threaded
Open this post in threaded view
|

Re: How to use external unix command

Antony Scriven
[My apologies for the mess I quote here, but there's no
way I can be bothered to fix up this one.]

On Jun 28, Varun Gupta wrote:

 > Hi All
 >
 > How do we in general (not any specific command ), use
 > the shell commands from VIM ??

Look up the help on the following.

   :read
   :!
   :'a, 'b!
   :w !            note, not :w!
   :read !

and probably more that I can't think of right now, such as
:e `cmd` for a start.

 >
 > --- Henrik <[hidden email]>
 > wrote:
 >
 > > Thanks a lot that is exactly what i needed :)
 > >
 > > Henrik
 > >
 > > On Tue, 2005-06-28 at 08:46 +0200, Fritz Mehner
 > > wrote:
 > > > Henrik schrieb:
 > > > >Hi Vimmers,
 > > > >
 > > > >how it is possible to write the date in a file
 > > using the external unix
 > > > >command (date)????
 > > > >
 > > > >
 > > > >Thankful for some hints ,
 > > > >Henrik
 > > > >
 > > > >
 > > > >  
 > > > :r!date
 > > >
 > > > or date with options (see "man date" )
 > > >
 > > > :r!date +%d-%m-%Y

You'll need to escape those %s.

:r!date +%d-%m-%Y
mutt-metawire-1830-1d-mutt-metawire-1830-1m-mutt-metawire-1830-1Y

:r!date +\%d-\%m-\%Y
28-06-2005

You may also like to note vim has a built in function,
strftime().

Antony