PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.ruby > executing VIM on a remote machine?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
executing VIM on a remote machine?

Réponse
 
LinkBack Outils de la discussion
Vieux 01/11/2007, 22h54   #1
gianmh@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut executing VIM on a remote machine?

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?

  Réponse avec citation
Vieux 01/11/2007, 23h33   #2
bbxx789_05ss@yahoo.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: executing VIM on a remote machine?

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-forum.com/.

  Réponse avec citation
Vieux 02/11/2007, 00h42   #3
1337p337@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: executing VIM on a remote machine?

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

  Réponse avec citation
Vieux 02/11/2007, 00h53   #4
bbxx789_05ss@yahoo.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: executing VIM on a remote machine?

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-forum.com/.

  Réponse avec citation
Vieux 02/11/2007, 01h00   #5
1337p337@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: executing VIM on a remote machine?

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.

  Réponse avec citation
Vieux 02/11/2007, 12h52   #6
gianmh@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: executing VIM on a remote machine?

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

  Réponse avec citation
Vieux 02/11/2007, 12h52   #7
gianmh@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: executing VIM on a remote machine?

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.
>
>


  Réponse avec citation
Vieux 02/11/2007, 12h56   #8
gianmh@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: executing VIM on a remote machine?

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

  Réponse avec citation
Vieux 02/11/2007, 14h04   #9
sylvain.joyeux@polytechnique.org
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: executing VIM on a remote machine?

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

  Réponse avec citation
Vieux 02/11/2007, 14h17   #10
hungrylist@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: executing VIM on a remote machine?

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/Unix/Sed.html

Paolo

  Réponse avec citation
Vieux 02/11/2007, 17h38   #11
boss@airbladesoftware.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: executing VIM on a remote machine?

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?tip_id=337

Forgive me if I have misunderstood your question.

Regards,
Andy Stewart


-------
http://airbladesoftware.com




  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 13h25.


Édité par : vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,28940 seconds with 19 queries