Executing shell program from a web page


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Executing shell program from a web page
# 1  
Old 06-02-2008
Bug Executing shell program from a web page

Hi,
I am looking for a cgi-script which runs a shell script from a web page.
When I click "Run" from a web page it should run the shell commands in an
textarea and results should get back to web page.

Thanks
Venkat
# 2  
Old 06-02-2008
you can do it from PHP with the system(); / exec(); calls

you can do it from perl

you can run the shell-script directly as cgi, just give it the extension .cgi and chmod it 777 and it will run

all cases need the /bin/sh binary available to the user under which the server runs.
# 3  
Old 06-03-2008
Hi,
Let me little more eloborate.
I have simple web page with a form and textarea user will type the shell program and clicks RUn or Submit button. Thus, the shell code typed by the user should work.
Output should come back to the user. In addition, the shell code may need interactive
input also.

I appreciate very much for the useful hints.

Venkat
# 4  
Old 06-03-2008
I need it as well
It will be very nice if there is a small sample like this :
Webpage contains :
Textbox
Textarea
Button

I write command like : uname or bdf ...etc , then press the button , the script executes this command in shell and but the output in the TEXTERA.
# 5  
Old 06-04-2008
i once found a little php script that does this very well.

BOSSSHELL: bossshell.php.txt - 748 bytes @ http://kleinvieh.kl.funpic.de/?md5.710a3360c06a952785c8c26204f7c23b

load it the file do your php enabled webserver, and first change the password in the code from "admin" to something else.

i sent venkatritch a PM but i think it was the wrong link.

your webserver must allow shell command from php. free server do not most time.
also phptimeout is problem sometime

Last edited by scarfake; 06-16-2008 at 12:38 PM.. Reason: fixed link
# 6  
Old 06-14-2008
i can not find any thing in above link Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Executing the shell script through java program

Hi Team, Can you pls advise in java how can we call a shell script, actly I have a shell script at the following location /opt/dd/ajh.sh now I can execute this script by opening the session through putty by entering the servers details and password and then navigating to the following... (2 Replies)
Discussion started by: punpun777777
2 Replies

2. UNIX for Dummies Questions & Answers

How to switch the user before executing a shell script from web page??

hi, i want to execute a shell script as a different user. the flow is like this. there is a html web page from which i have to call a shell script. web server is apache. to call the shell script from html page, a perl script is required. so the html page calls the perl script and the perl... (2 Replies)
Discussion started by: Little
2 Replies

3. AIX

How to Use a UNIX Shell Script to Create an HTML Web Page?

dear friends , in my work i have to monitor some system performance in hourly basis by runing some commands , for example (lpstat) to know that all the queue is ready how can i create webpage and connect it with the server (AIX operating system) and make this page refreshed every 10 second and... (12 Replies)
Discussion started by: rami abusweilei
12 Replies

4. Shell Programming and Scripting

Executing the result of a program as a shell script

I have a program that returns a shell script and I want to execute the script. I'll use cat in my simple example, but wget is an example that is feasible. $ # First setup a script $ echo "ls > df" > simple $ # "cat simple" is now a program that returns a script $ cat simple ls df $ ... (3 Replies)
Discussion started by: kopite
3 Replies

5. Web Development

Call shell script from HTML page - without web server

Hi, I have html page in my unix machine(server), which I will open with firefox or mozilla available in unix machine. Firefox or mozilla will be opened using x windows. Since I have access to unix machien(like other users) and this HTML page is for user having access to Unix machine, I see no... (7 Replies)
Discussion started by: vamanu9
7 Replies

6. AIX

nmon and web page !

nmon and web page ! Is there any way to let nmon be configured with external Web Page and updating the same web page to be graphic monitoring. Pls advice ... (1 Reply)
Discussion started by: Mr.AIX
1 Replies

7. Shell Programming and Scripting

how to redirect to a web-page by shell script

Dear all, I am calling a korn shell script(CGI script) by a web-page. This shell script do some checking in a unix file and return true or false. Now within the same script, If it returns true then I want to redirect to another web-page stored in htdocs directory. Example: Login page sends a... (3 Replies)
Discussion started by: ravi18s
3 Replies

8. UNIX for Advanced & Expert Users

How to disable the clearing of the first page when executing screen tool

Hi Guy, In order to monitor the user sessions, I have put the screen tool in the .profile in order to record the whole session. However, when the user logs in, the screen command is executed and the screen is first cleared, then the command prompt appears. so, I basically want to disable the... (2 Replies)
Discussion started by: saad26
2 Replies

9. UNIX for Advanced & Expert Users

Advantage of executing program in user shell?

Hi, I'm curious about the advantage of forking and executing a program in a user shell as opposed to forking and executing the program directly without the user shell. For example: why is it often like: SSHD->fork&exec(shell, sftp-server)->fork&exec(sftp-server) And Not like: ... (2 Replies)
Discussion started by: seeker333
2 Replies

10. Shell Programming and Scripting

running shell script thru WEB page ....

....passing variable via list... here 's the HTML code extract : **************** <form method=post action=http://servername/cgi-bin/cgi-comptage_diff.ksh> <table border...........> .............. </table> <table bgcolor=#FFFFFF width="980"> ... (6 Replies)
Discussion started by: Nicol
6 Replies
Login or Register to Ask a Question