invoking a shell script inside cgi shell script

Hi,
I have an HTML form through which I get some text as input. i need to run a shell script say script.sh inside a perl-cgi script named main_cgi.sh on the form input.
I want to write the contents of the form in a file and then perform some command line operations like grep, cat on the text and thn output the result as HTML.

I am not able to find out what's gone wrong with the script. I am not able to write the text in the file and also the script.sh is not working.

The scripts are as following -

#!/bin/sh
# main_cgi.sh

eval `proccgi.sh $*`

echo "Content-type: text/html"
echo
echo "<HTML>"
echo "<BODY>"
echo "<center>"
echo "<H1>Results </H1>"
echo "$FORM_seqinput" |tr '\015' '\012' >file_1
echo "<br><br><H3><fontcolor = #800000>"
echo " 'cat file_1' "
./script.sh
if test -s res.out
then
echo "<br><br><H2><fontcolor = #000080>"
echo " 'cat res.out' "
fi
echo "</font></H3><br>"
echo "</center>"
echo "</BODY>"
echo "</HTML>"

#!/bin/sh
# script.sh
cat file_1 | wc -l >res.out

I will be thankful for your suggestions.

Smriti

Have you tried using the full path to script.sh instead of ./?

I presume you've made sure that the file is executable the user that owns Apache?

Thanks! :b: it worked.

smriti