I want to run a shell script on the azure web hosting server while hosting the Django project my Django view contains a subprocess
module code to run the shell script but I don't know which shell is used by my server, bash or something else and I am unable to run that shell script. So How do I run a shell script in the azure web hosting server or any other web hosting server?
I tried using python
import subprocess
sp = subprocess.Popen(['echo $0'], stdout=subprocess.PIPE)
# or
sp = subprocess.Popen(['echo', '$0'], stdout=subprocess.PIPE)
# or
sp = subprocess.Popen(['echo $0'], stdout=subprocess.PIPE, shell=True)
# or
sp = sp = subprocess.Popen(['echo', '$0'], stdout=subprocess.PIPE, shell=True)
x=sp.communicate()
# send response to me or print(x)
to know which bash is used by my hosting server but get nothing. Can I simply use
script.sh
#!/bin/bash
my stuff