operation not permitted on some shell scripts spontaneously
I have some shell scripts that I have used for years to launch Java programs, and they were working perfectly yesterday. A colleague had a shell script that needed some corrections to it, and after editing that shell script it would not run with the error "operation not permitted". After verifying that everything in the shell script worked by pasting commands into my shell, the error persisted. Then I copied the working shell script contents into the script that was not working. Still did not work. Then made a new shell script with "/bin/ls" as the contents. Did not work with same error. Then my original shell script(s) in that folder stopped working with the same "operation not permitted" error.
I discovered I can run the command "/bin/csh myscript" and that works just fine. After more frustrating attempts to find solutions I created a new shell script in my home directory with the simple one line command and it works exactly as expected. If I copy that shell script into the directory where I was working previously it stops working. And now no matter where I copy that script it won't work any longer.
There seems to be some internal security mechanism that has suddenly blacklisted shell scripts in certain directories and with certain names, but I have no idea how find where that source is, how to de-blacklist the directory or shell scripts.
Note, I have rebooted multiple times, added bash, csh, tcsh, sh and zsh to the list of programs with Full Disk Access, and even included one or two the sample shell scripts in the list of programs with Full Disk Access, and turned off Norton Internet Security. And nothing changes the result.