"Operation not permitted" for command line script, Full Disk Access granted
I have System Integrity Enabled, and have granted Full Disk Access to Terminal. In the Terminal, as any user including root, running the script test.sh yields:
./test.sh: Operation not permitted.
for the script in test.sh as:
-------
#!/bin/bash
ls
-------
On other computers with essentially the same setup, the script works without a problem.
Some scripts work and others do not. Sometimes, when I edit a script and modify the #! line in various ways and save, eventually the script runs. But I cannot see any consistency.
I tried "csrutil reset" and rebooting. Cleared all caches with TinkerToolSystem.app and rebooted. I cannot find any log entries, there must be someplace where SIP logs issues, but I did not find it.
I tried installing iTerm2 and granting that program Full Disk Access. Same result.
Thanks for any suggestions.
iMac Line (2012 and Later)