[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

executing VIM on a remote machine?

Gian Holland

11/1/2007 8:54:00 PM

Is is possible with ruby to execute vim on a remote machine to edit a file?
can some one point me in the right direction?

10 Answers

7stud --

11/1/2007 9:33:00 PM

0

Gian Holland wrote:
> Is is possible with ruby to execute vim on a remote machine to edit a
> file?
> can some one point me in the right direction?
>

Why would you use vim instead of editing the file directly, e.g.

File.foreach("data.txt") do |line|
#do something to line
end


--
Posted via http://www.ruby-....

Pete Elmore

11/1/2007 10:43:00 PM

0

On 01/11/2007, Gian Holland <gianmh@gmail.com> wrote:
> Is is possible with ruby to execute vim on a remote machine to edit a file?
> can some one point me in the right direction?
ruby -e 'system "ssh user@machine vim remote_file"'
SCNR

7stud --

11/1/2007 10:54:00 PM

0

Pete Elmore wrote:
> On 01/11/2007, Gian Holland <gianmh@gmail.com> wrote:
>> Is is possible with ruby to execute vim on a remote machine to edit a file?
>> can some one point me in the right direction?
> ruby -e 'system "ssh user@machine vim remote_file"'
> SCNR

Does that edit the file?
--
Posted via http://www.ruby-....

Pete Elmore

11/1/2007 11:01:00 PM

0

On 01/11/2007, 7stud -- <bbxx789_05ss@yahoo.com> wrote:
> Pete Elmore wrote:
> > ruby -e 'system "ssh user@machine vim remote_file"'
> > SCNR
>
> Does that edit the file?
Well, it does start up vim on the remote file, so, provided you change
it and then hit :wq, it'll edit it. :)

Gian Holland

11/2/2007 10:52:00 AM

0

On 11/1/07, Pete Elmore <1337p337@gmail.com> wrote:
> On 01/11/2007, Gian Holland <gianmh@gmail.com> wrote:
> > Is is possible with ruby to execute vim on a remote machine to edit a file?
> > can some one point me in the right direction?
> ruby -e 'system "ssh user@machine vim remote_file"'
> SCNR
>
>

That worked but now I am getting strange characters when i use the
back key and hit esc to go into command mode

Gian Holland

11/2/2007 10:52:00 AM

0

On 11/1/07, Pete Elmore <1337p337@gmail.com> wrote:
> On 01/11/2007, 7stud -- <bbxx789_05ss@yahoo.com> wrote:
> > Pete Elmore wrote:
> > > ruby -e 'system "ssh user@machine vim remote_file"'
> > > SCNR
> >
> > Does that edit the file?
> Well, it does start up vim on the remote file, so, provided you change
> it and then hit :wq, it'll edit it. :)
>
>

Gian Holland

11/2/2007 10:56:00 AM

0

On 11/1/07, Pete Elmore <1337p337@gmail.com> wrote:
> On 01/11/2007, Gian Holland <gianmh@gmail.com> wrote:
> > Is is possible with ruby to execute vim on a remote machine to edit a file?
> > can some one point me in the right direction?
> ruby -e 'system "ssh user@machine vim remote_file"'
> SCNR
>
>

also
vim warns
output not to a terminal
input is not form a terminal

Sylvain Joyeux

11/2/2007 12:05:00 PM

0

On Friday 02 November 2007, Gian Holland wrote:
> ruby -e 'system "ssh user@machine vim remote_file"'

You need to use the -t option of ssh to get a pseudo terminal.

Sylvain

Paolo Negri

11/2/2007 12:17:00 PM

0

On 01/11/2007, Gian Holland <gianmh@gmail.com> wrote:
> Is is possible with ruby to execute vim on a remote machine to edit a file?
> can some one point me in the right direction?
>
>

you should look into 'sed' which is a command line editor and acts in
many ways as vim does without being interactive.
http://www.grymoire.com/Uni...

Paolo

Andrew Stewart

11/2/2007 3:39:00 PM

0

Hi,

On 1 Nov 2007, at 20:54, Gian Holland wrote:

> Is is possible with ruby to execute vim on a remote machine to
> edit a file?
> can some one point me in the right direction?

I'm not sure I understand your goal, but if you wish to use vim to
edit a remote file vim does this out of the box:

http://www.vim.org/tips/tip.php?...

Forgive me if I have misunderstood your question.

Regards,
Andy Stewart


-------
http://airbladeso...