Execute an interactive command from a webpage using an ubuntu server (no gnome)


I am trying to install some software onto my ubuntu server and am having difficulty.

Some of the commands involved lengthy typing or file configurations so I thought I would just copy and paste.

Question: what is the best way to run interactive software setup from a server with no gnome or GUI?

What I have tried:

First I downloaded Lynx so I could see it in a non GUI environment (terminal). Then I tried to execute the commands from within Lynx (without success) so I managed to save the printed screen output to a file (randomly called install.txt)


I use vim.

With the downloaded and copied HTML page now in a txt format I
I then tried to execute the commands from within the file using vim :.w !bash and was successful with simple test commands like touch test.html

However it did not work with more complicated commands as I stayed in vim and could not see what it was prompting me to do.

I then tried to copy and paste the lines into my shell but as I am in a server I do not have the X11 or gnome set up so vim clipboard is not enabled

I think I am a little flummoxed :blush:

  1. How can I execute an interactive command from a vim file?

  2. How can I copy and paste from vim to shell without X11 or having to install the vim-gtk or do I need that?

  3. Can I use vim or is there a different text editor that is terminal based that allows me to copy and paste between a server environment and the editor (preferably not to learn a whole new editor - but I will if I have to).

I am guessing that this is a fairly common problem for people who work In a server environment with tight constraints as to no GUI no gnome no kubuntu etc.



I just saved the file in vim and executed the commands one at a time using shell_exec and echo from within the file while commenting g everything else out.

Then I executed the commands using PHP /path/to/file

It does work although not too pretty.


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.