I create a test shell script in my Desktop directory, make it executable and it runs OK. I copy it to a mounted SD chip and the attributes change and execution fails.
Here is a test example. Note the command prompt is the working directory. It was slightly edited (added blank lines and deleted some prompts) for clarity.
I don't understand why the attributes change and why the script fails.
## print file test.sh contents Desktop>> cat test.sh #!/bin/bash echo 'Works OK' Desktop>> ## list file attributes to verify it is executable. ##Note attributes. They change after file copy. Desktop>> ls -al test.sh -rwxr-xr-x. 1 ron ron 28 Feb 16 13:41 test.sh Desktop>> ## run the shell ## shell output is correct. Desktop>> ./test.sh Works OK Desktop>> ## copy shell to SD chip Desktop>> cp test.sh /media/removable/10-EDC/org Desktop>> ## change to SD chip Desktop>> cd /media/removable/10-EDC/org org>> ##list file attributes. Note that they have changed. ## org>> ls -al test.sh -rwxrwxrwx. 1 ron ron 28 Feb 16 14:58 test.sh org>> ## run the shell. Fails. org>> ./test.sh bash: ./test.sh: Permission denied org>>
OS is Ubuntu 16.04.
It has been suggested that it may have something to do with the way the SD chip was formatted. I believe it is formatted as msdos (fat??) for compatibility with other machines. I have no experience in this (formatting issues) area.
Any assistance appreciated.