OSX Shell Error Operation Not Permitted



  • So while I'm working on getting more Apple devices configured I realized that I had to make a change to my shell script. So I lazily went and opened the shell script with TextEdit on OSX Mojave.

    Once the changes are made and saved a "quarantine attribute" can (read this as does) get added to the file.

    To confirm if this attribute is added to your file run xattr -l /file/path/file.ext

    To remove the attribute run xattr -d com.apple.quarantine /file/path/file.ext

    Obviously you'll need to use your file path and extension which in this case for me was /Volume/USB/Brew/brew-acct.sh

    Hope it helps for anyone else who has to deal with Apple



  • Just used this again today, as another script I have had this attribute.

    Not sure when the attribute was written to the script though. But it's working now.

    This is the full error.

    /bin/sh: bad interpreter: Operation not permitted