I am getting some error while running the .sh script using Python and Django. The errors are given below.
Traceback (most recent call last):
File "cell.py", line 3, in <module>
subprocess.call(shlex.split('./test.sh param1 param2'))
File "/usr/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
I am explaining my code below.
cell.py:
import subprocess
import shlex
param1='Reactor1'
param2='Running'
subprocess.call(shlex.split('bash test.sh',param1,param2))
test.sh:
#!/bin/sh
echo $1
echo $2
exit 0
While I was running the file I am getting the above error. Please help me to resolve this error.
test.shhave the+xattribute set?bash test.sh param1 param2./test.sh param1 param2right ?