Operation not permitted. Could it be because it is a bash script?
The error message Operation not permitted
can occur because you are attempting to set the setuid
bit on a Bash script.
Most modern Unix-like operating systems, including Linux, ignore the setuid
bit on scripts for security reasons. Setting setuid
on scripts can lead to various security vulnerabilities, such as privilege escalation attacks, which is why the operating system typically disallows it.