5 Replies Latest reply: May 22, 2012 6:49 AM by Bradley Ross
hurbas Level 1 (0 points)

After an OS X Lion update which happened this afternoon, TextEdit is suddenly behaving in a strange way.

When I open a bash script with TextEdit and leave the script unchanged, the script still runs normally.

But as soon as I hit any key on the keyboard (even without saving the file), the script cannot be run any

more and, assuming the script's name is kaps, I get this message:


-bash: ./kaps: Operation not permitted


If I issue the command xattr kaps, I get this:





If I reset the xattr, the file will run again, but as soon as I modify the script with TextEdit, the above

happens again. And this occurs with any script (old or new).


Strangely enough, this seems to affect only files run with the  x attribute (chmod +x), because, even

if they are now quarantined, the scripts can be run if sourced (ex:   . kaps  o r   bash ./kaps).


Any idea how to prevent TextEdit from arbitrarily quarantining the files it edits?

iMac (21.5-inch Late 2009), Mac OS X (10.7.2)