I have a python script (scriptname.sh) that gets created with permissions such that it isn't executalbe (Permission denied when try to execute it).
at the command line for mac, I can do the following at the mac command line
chmod 775 scriptname.sh
and it will execute. This gives -rwxrwx-x permissions.
I tried doing that programmatically in a python script that creates it with
os.chmod(filenamePath, 755)
but it gives --wxrw--wx and won't execute.
What should I put in the python script so that the permissions will be correct to execute the script at the command line?
(Updated) I also tried running the script at the bash prompt (with permissions given with os.chmod above) and scriptname.sh isn't executable at the command line with
./scriptname.sh
I looked at chmod, and I'm setting permissions in python a way that is mentioned. I also looked at permissions to see what permissions (755) are needed to be able to execute the script. I'm not sure why changing it to 755 is behaving different ways at the command line vs programmatically.