|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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? |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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/. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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/. |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
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. ![]() |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
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. ![]() > > |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#10 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#11 |
|
Messages: n/a
Hébergeur: |
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 |
|
![]() |
| Outils de la discussion | |
|
|