I have shell code which need to be initialised with python variable
Note : the var is a python variable which holds value /d/demo/f.txt
Need to pass the python variable var
to my below shell script
var='/d/demo/f.txt'
script="""
(
echo "From : xyz"
echo "To : xyz"
cat var
) |sendmail -t
"""
os.system("bash -c '%s' % script ")
The var value assigned is not passed to cat var
Any solution is appreciated