0

At work I have a long command that I frequently execute in terminal. It has 6 variables that I have to change each time I use it. Rather than copy and paste my command from a text file and manually alter the variables, I am trying to come up with a simply way to create a GUI that will allow me to make changes and execute it. Probably there is other solution than HTML.. The only purpose is to be able to conveniently pass the arguments to a command line.

I use Ubuntu 10.04 (Lucid Lynx).

The suggestions are very appreciated.

asked Sep 20, 2011 at 9:24

3 Answers 3

1
  1. Run a server (Apache is common, Lighttpd is small).
  2. Create a form.
  3. Write a server side process in your language of choice (I lean towards Perl) that receives data from the form, acts on it, and then delivers a new HTML document to the browser.
answered Sep 20, 2011 at 9:27
Sign up to request clarification or add additional context in comments.

2 Comments

Excellent! I'm working with Ruby but I am definitely not a developer yet. Could you please, give me a hint on how to write server side process?
The comments about CGI in the link (marked Perl) apply as much to Ruby as any other language. Ruby also has other ways to run under webservers, but I'm not very aware of them. Rails is a popular framework for Ruby web apps.
1

I suggest you to write a shell script taking input variables. You could then call it like this (example):

myScript.sh paramValue1 paramValue2 
answered Sep 20, 2011 at 9:28

3 Comments

The point is that the parameters I use vary every time. That is the reason why I want to create a convenient interface to pass them.
I dont' exactly understand. You have to type them anyway, no? So what's the difference in typing them into a web page or into a terminal?
On the web page I can use check boxes.
0

The simplest way to do this from a browser is probably to build an HTML form that submits to a PHP script. Have the PHP script pull the $_POST parameters off and exec them.

You may find that your computer is already running PHP in a web server, or that it is very easy to install and use.

answered Sep 20, 2011 at 9:27

1 Comment

Thank you Sky! I use Ruby and Ruby on Rails in my everyday life. Hopefully, I'll be able to find the alternatives in Ruby.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.