Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recommendation to Create Simple GUI in UNIX 2

Status
Not open for further replies.

h3nd

Programmer
Jul 1, 2006
147
AU
Hi guys,

I just need to create a simple GUI as a trigger for my script.

Because we can't give access to business our UNIX server. But they the one who decide when the script should be run.
So, I just need advise or clue how do I deal with this.

Your advise will be appreciated.

Thanks guys,
 
Hi

No idea what is available on Unix, but there should be some dialog too. On Linux is [tt]Xdialog[/tt] ( independent one ), [tt]kdialog[/tt] ( comes with KDE ), [tt]gdialog[/tt] ( part of the Gnome ) and a few others. I find [tt]gdialog[/tt] is the trickiest : if can connect to X, then displays graphic windows, otherwise text. For simple text dialogs there is an old [tt]dialog[/tt] too. All this are designed for use from shell scripts.

By the way, Tcl/Tk is incredibly easy to use for creating some graphic interface windows and make simple operations.

Feherke.
 
I've had a similar issue in the past.
Writing a python program using tkinter gui toolkit would still require them to access the shell, and export display to an X-Server.
Writing a gui program for Windows to access the server either via ssh or a socket seemed to much of an effort.
In the end I just installed Apache and enabled cgi.
The users kick off the scripts via the web interface.


"If you always do what you've always done, you will always be where you've always been."
 
Thx feherke,

But I probably need some GUI running on windows but execute some script in UNIX like control M. But unfortunately I can't give access to them about control M.

Do you have any other idea regarding this ?

Thx man
 
You could use usermin google for webmin to find it.

Or create a script that check for a filename and run your script. Then write a simple vb front-end for windows that ftp's the file to the unix box which then starts the script.

Mike

"When we ask for advice, we are usually looking for an accomplice."
 
Hi mrn,

where should I write to vb code, does it mean I need to install microsoft vb ?

Thx man
 
It doesn't have to be VB use any language your into... Could even be a batch script

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
Yeah,

but I need an idea to implement, what software u reckon the simplest to create GUI to trigger my script ?

Thx guys
 
What about a web-based interface using CGI scripts?

Regards,
Chuck
 
Did you google for usermin?


Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
What about a web-based interface using CGI scripts?

ok cspilman, do I need to setup something in my server first.

How the script look like ?
 
You would need to have http server software installed (i.e. apache).

Scripts are very simple depending on what programming language you use. You can use just about anything, shell (ksh, sh, bash), perl and I've even seen CGI programs written in C.

If you were to use this method, you would need to make sure apache or whatever http server you are using is configured properly and running, and then you would create a form that pointed to the CGI script that you have. For example, your html might have an insert like this:

Code:
 <FORM action="/path/to/cgi-bin/myscript.cgi" method="get">
    <INPUT type="submit" value="Send"> <INPUT type="reset">
    </P>
 </FORM>

Then you would create your "myscript.cgi" script somewhat like this:

Code:
#!/bin/ksh

/path/to/command

Make sure the script is excutable and can be run by whoever the user is that starts the http server (usually nobody or apache).

since you are only wanting to give them the ability to run the command you don't have to display anything so the script is very simple. If you wanted to display a page or pass arguments to the script from the html form, that is a different story, but again, it's not that difficult once you figure out how CGI works.

Regards,
Chuck
 
Sorry, rzs0502.

I reread over all the posts in this thread and saw that you had mentioned the CGI scripting well before I did.

Regards,
Chuck
 
Thx cspilman,

I'll try to contact my sysadmin to install apache then.

I know about HTML codes.

Ok, I think I know what to do.

thanks heaps man
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top