How to capture STDOut of script in a CGI script?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How to capture STDOut of script in a CGI script?
# 1  
Old 11-10-2008
How to capture STDOut of script in a CGI script?

Hi Perl Experts,
I am invoking a shell script thru a perl script and the perl script is cgi script.I need to capture the STDOUT of the shell script in the html page where I am invoking the script .?The shell script takes couple of mintutes to complete its execution .Mean while my html page does not show any thing.I want to display the STDOUT of the shell script in the html page.

ThanksSmilie
# 2  
Old 11-10-2008
if you are executing the external script by backticks then just capture the output into a variable, and print that variable.
system() does not return the external programs output, just it's exit code
exec() does the same as system, and never returns
use backticks.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Capture run time of python script executed inside shell script

I have bash shell script which is internally calling python script.I would like to know how long python is taking to execute.I am not allowed to do changes in python script.Please note i need to know execution time of python script which is getting executed inside shell .I need to store execution... (2 Replies)
Discussion started by: Adfire
2 Replies

2. Shell Programming and Scripting

How to capture the exit code of a shell script in a perl script.?

hi, i want to pop up an alert box using perl script. my requirement is. i am using a html page which calls a perl script. this perl script calls a shell script.. after the shell script ends its execution, i am using exit 0 to terminate the shell script successfully and exit 1 to terminate the... (3 Replies)
Discussion started by: Little
3 Replies

3. Shell Programming and Scripting

How to capture exit code of child script and send it to parent script?

#!/usr/local/bin/bash set -vx /prod/HotelierLinks/palaceLink/bin/PalacefilesWait /prod/HotelierLinks/palaceLink/bin/prodEnvSetup 03212013 & if then echo "fatal error: Palace/HardRock failed!!!!" 1>&2 echo "Palace Failed" | mail -s "Link Failed at Palace/HardRock" -c... (1 Reply)
Discussion started by: aroragaurav.84
1 Replies

4. Programming

CGI Perl script to execute bash script- unable to create folder

Hi I have a bash script which takes parameters sh /tmp/gdg.sh -b BASE-NAME -n 1 -s /source/data -p /dest/data/archive -m ARC gdg.sh will scan the /source/data and will move the contents to /dest/data/archive after passing through some filters. Its working superb from bash I have... (0 Replies)
Discussion started by: rakeshkumar
0 Replies

5. Web Development

problem with exporting vairable from one perl cgi to another perl cgi script while redirecting.

Can anyone tell me how to export a variable from one perl CGI script to another perl cgi script when using a redirect. Upon running the login.pl the user is prompted to enter user name and password. Upon entering the correct credentials (admin/admin) the user is redirected to welcome page. My... (3 Replies)
Discussion started by: Arun_Linux
3 Replies

6. Programming

Capture stdout from multiple processes

I have a number of binaries which I currenlty have no control over. They alright data to stdout. I would like to kick off any number of these binaries and capture and process their stdout. Doing this for one process is straight forward for example - comments and error checking removed for... (6 Replies)
Discussion started by: dvales
6 Replies

7. Shell Programming and Scripting

Perl cgi script to call bash script?

Novice to perl here. I have created a simple web page in perl, with only one submit button. I would like to execute a bash script on the same server when this button is clicked on. Is this possible in perl? I have spent a few days researching this and am unable to find any useful information.... (0 Replies)
Discussion started by: pleonard
0 Replies

8. Shell Programming and Scripting

call shell script from perl cgi script problem

hi,, i have perl scipt with line : system('./try.sh $t $d $m'); in shell scipt try.sh i have the line: echo $1 its not printing value of $t that i hav passed..y is it so..i am running it from apache web server (2 Replies)
Discussion started by: raksha.s
2 Replies

9. UNIX for Dummies Questions & Answers

not able to capture STDOUT

I am using a third party API to get some real time feed. When I run the command it shows the results properly: etd@mhs-apps5009 $ mamalistenc -m lbm -tport mamaqa -S MLALERTS -s KANA wFinancialStatus Type CTRL-C to exit. (null).MLALERTS.KANA Type: INITIAL Status OK wFinancialStatus |... (5 Replies)
Discussion started by: aks__
5 Replies

10. Shell Programming and Scripting

CGI passing arrays/hashes to another CGI script

If I have a Perl CGI script (script01), which fills an array(s) with information and outputs a HTML page with a link to another CGI page (script02); is there anyway to pass the array(s) from "script01" to "script02" when the page visitor clicks the link? Hope that makes sense! :) (2 Replies)
Discussion started by: WIntellect
2 Replies
Login or Register to Ask a Question