I have a script on a RHEL 7.x machine written in Python3. In testing this script I created a function which will append to a text file in the same directory.
If I execute the script from the local directory ie -
./pyscript.py everything works as expected.
But I am trying to execute this from a Bash script a couple directories higher and it doesn't seem to work right. The other functions in the script will execute, but this very last one which appends to a text file will not.
Now, if I run the script as the user which owns it(and the txt file) from my home dir, the script errors out with a permission error. BUT if I run the script with
sudo it finishes with NO error, However it does NOT write to the text file.
My user has RW privileges on every dir between the bash script and the python script.
Any thoughts on why a
sudo or local user run doesn't seem to let me write to the text file??