When I run client.sh script no output is coming. And when I use "system" command in php the client.sh script is running in infinite loop.
Server.sh: code:
#!/bin/bash
while :
do
printf "Do you want to continue:[Y/N]\n"
read ans
case $ans in
"Y")continue;;
"N")echo "Thank you"
exit 0;;
"*")echo "Wrong choice"
continue;;
esac
done
Output:
srikanth@localhost:~/www/phpshell$ ./scm.sh
Do you want to continue:[Y/N]
Y
Do you want to continue:[Y/N]
N
Thank you
Calls.php: Code:
<?php
$cmd="/home/srikanth/phptest/server.sh";
pcntl_exec($cmd);
?>
Output:
srikanth@localhost:~/phptest$ php calls.php
Do you want to continue:[Y/N]
Y
Do you want to continue:[Y/N]
N
Thank you
Client.sh code:
#!/bin/bash
curl http://cxps103/svnadmin/calls.php
Output:
srikanth@localhost:~/phptest$ ./client.sh
Any suggestion would be of much help. Thank you.
Update:
As per Ibu's suggestion am simplifying my question, I had got the problem, there is a while loop in my server.sh script which causing a problem,