I'm able to pass a variable from HTML form to a simple perl script. This is the main line from perl script.
system("/var/www/cgi-bin/aaa $name")
The perl script calls a bash script called aaa. As you see I pass the $name which is the entry from my html form to aaa bash script. In my bash script I can echo the $name as $1 or assign $1 to $name. So so far so good. That's the way I want it. However in my aaa bash script I have a ssh command in aaa script that is not working. No matter how many different way I tried it it just not working. If I run the aaa script command from command line and pass a parameter , the script works fine, but when I try it via the perl it fails.
my ssh command right now is very simple. So my aaa bash file contains a simple line
echo $1
ssh $1 "ls -altr" > /var/www/cgi-bin/output
If I call this script from command line ( aaa serverx ) It works fine. Now I do it through the html form and the only thing that works is the echo $1 command. Another word I can see that I'm passing the right servername ( example serverx) and when I do echo $1 I can see the serverx. However, the ssh line fails. Noyt sure what to do ? Can anyone help ?
Regards