cannot see the echo sshpass output in my portal
by patrik_ from LinuxQuestions.org on (#4YMNF)
Hello guys,
Thanks for allow me to be part of this community. I very new at Linux and I'm running my first project. So far I guess is working however when I want to display the output of a command in the html portal I dont see anything. Here is the bash:
#!/bin/bash
read -p "Mac given: " Add
if [ "$1" != "" ] ; then
Add=$1
fi
echo "Content-type: text/html"
echo $Add <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<this output is visible and i can confirm that what ever I receive from the PHP script is correct
echo ""
echo "<html><head><title>Bash as CGI"
echo "</title></head><body>"
echo "<center><h1>Find the information below</h1></center>"
echo $(sshpass -p XXXXX ssh XXXXXX@XXXXX show mac address-table address $Add) >>>>> Here is where it fails. If I run the batch I can see the output but if I go the portal I dont see anything.
echo ""
echo "<center>INITIAL TEST</center>"
echo "</body></html>"
Any help will be much appreciated !


Thanks for allow me to be part of this community. I very new at Linux and I'm running my first project. So far I guess is working however when I want to display the output of a command in the html portal I dont see anything. Here is the bash:
#!/bin/bash
read -p "Mac given: " Add
if [ "$1" != "" ] ; then
Add=$1
fi
echo "Content-type: text/html"
echo $Add <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<this output is visible and i can confirm that what ever I receive from the PHP script is correct
echo ""
echo "<html><head><title>Bash as CGI"
echo "</title></head><body>"
echo "<center><h1>Find the information below</h1></center>"
echo $(sshpass -p XXXXX ssh XXXXXX@XXXXX show mac address-table address $Add) >>>>> Here is where it fails. If I run the batch I can see the output but if I go the portal I dont see anything.
echo ""
echo "<center>INITIAL TEST</center>"
echo "</body></html>"
Any help will be much appreciated !