run shell script from browser


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers run shell script from browser
# 1  
Old 04-11-2009
run shell script from browser

my shell script is to reset user menu:

#!/bin/ksh

echo "Type in login id: \c"
read username

if [ -z "$username" ]
then
echo "....."
echo "You have not entered any INPUT value."
echo "...Goodbye..."
sleep 10

exit
else
echo $username
rm -f /.../../$username.xml
fi
# 2  
Old 04-11-2009
A browser is a program which reads from a network device and displays its content in some way. A script is a program run on a machine.

Sorry for being so abstract, but it seems that you are missing the underlying architectural implications of your question.

To begin with your script would have to communicate with a web server. Only the web server generates the network stream which could be understood by a browser. There is a general interface for this, which is called CGI. I suggest you read a book about CGI programming, because this is way too complex to be explained in a few words here.

Yes, you could use ksh to write CGI programs (in fact it is one of the best languages to do so).

You would then have to create a web page (some HTML-documents), which takes the input from the user (over the network), passes this input to the script, takes the result of the scripts run (if any) and then displays this to the user.

I hope this helps.

bakunin
# 3  
Old 04-11-2009
looks like this has been answered

and very well i might add =)


https://www.unix.com/unix-dummies-que...cript-cgi.html
# 4  
Old 04-11-2009
yes, i meant to run from cgi. thanks.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to convert my /bin/sh script with cgi and html to run it on browser!??

Hello, I want to run this script on my CentOS 6 via browser : ________________________________________________________________________________________________ #!/bin/sh echo Username? read MY_NAME echo Provisional file name? read MY_FILE echo File NAME you want to save? read MY_FILE2... (16 Replies)
Discussion started by: juta2020
16 Replies

2. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies

3. AIX

Can I run this thing in a web browser?

Old AS/400 guy here now administering an AIX system. We have an application that runs on 3151 emulator. Is it possible via an program or other to run a 3151 session in a web browser? I would like to have some of my user be able to work from home without having to install an emulation program, and... (1 Reply)
Discussion started by: jeveretts
1 Replies

4. Shell Programming and Scripting

Execute shell script from browser through php

Hi all, I want to execute a shell script in which I call ssh to execute a remote command. Everything works fine from command line but when I try to call from PHP (with exec or whatever function) it fails. After some time I came to the root cause: when www-data execute the ssh command it asks... (4 Replies)
Discussion started by: Evan
4 Replies

5. Shell Programming and Scripting

Control browser from shell script

I have a browser running in a separate virtual terminal and would like to be able to send shortcut codes (e.g. ctrl+A) to the browser (and have it react) from a bash script in a separate virtual terminal. I need to keep the script in the separate virtual terminal. (2 Replies)
Discussion started by: slak0
2 Replies

6. Shell Programming and Scripting

Help need to make a shell script run for ffmpeg vhook watermaking in shell

i have a small problem getting a batxh shell script to run in shell this is the code the problem seems to be centered around the ffmpeg command, something maybe to do with the ' ' wrapping around the vhook part command this is a strange problem , if i take the ffmpeg command and... (1 Reply)
Discussion started by: wingchun22
1 Replies

7. Cybersecurity

Run browser over VPN

Dear All , I have a web Application which I used in my work it's installed on an AIX machine . I need to access this application from my home when I connect to my work via VPN , but the browser not work at all . I did a work around by installing mozilla broswer on the AIX machine and make... (2 Replies)
Discussion started by: habuzahra
2 Replies

8. Shell Programming and Scripting

How to Run a shell script from Perl script in Parent shell?

Hi Perl/UNIX experts, I have a problem in running a shell script from my perl script (auto.pl). I run the perl script using perl auto.pl from the shell prompt The shell script picks the files in "input" folder and procesess it. The shell script blue.sh has this code. export... (16 Replies)
Discussion started by: hifake
16 Replies

9. UNIX for Dummies Questions & Answers

Need Shell script for getting Firefox Browser Version

Hi, How to write a script for finding out firefox version in our linux machine? Could you please share the same? I am using Red Hat Linux machine. Thanks, Kammy (2 Replies)
Discussion started by: kjannu
2 Replies
Login or Register to Ask a Question