I have written a shell script which is using the expect method, it is working fine in terminal window, and then I have executed via python script its also working fine in command prompt functioning properly, I used subprocess.Popen method to execute the shell script file, its working fine in terminal window, when I try to execute via web browser it says that error "send: spawn id exp3 not open while executing "send -- "pwd\r"" (file "/var/www/Site/test.sh" line 5). the same is executing from command line (ie) python /var/www/Site/test.py it executes perfectly
Below is my shell script and python script
send -- "pwd\r"
send -- "\r"
#below is my python script to execute the shell script files
print "Content-type:text/html\n\n Fail: "+command+str(stderr)
print "Content-type:text/html\n\n Success"+command
print "Content-type:text/html\n\n fails"+str(e)
Thanks in advance