I am attempting to create a simple bash script on MacOS (Mojave 10.14.5) and the script will not execute (permissions are set to execute!). The error returned is “/bin/bash: bad interpreter: Operation not permitted” .
From what I can determine via web searching there is a file attribute com.apple.quarantine that has a value of 21 and this is preventing the script from being executed.
My other, very much older, scripts in this folder do not have this attribute set at all. So I am assuming MacOS is doing this to prevent malicious actors from adding and executing scripts without our knowledge.
My web searches have provided various options for correcting this issue for individual scripts but I can find not decent description from Apple (having checked at the Developers site) as to how user should approach this problem. I also have not seen anything that says we should not write shell scripts.
Has anyone on this forum run into this problem and/or found any decent documentation on this topic?
The following two lines produce the results described. The script is located in ~/Scripts and this directory is on my path.