问题
I made script (steamBlob.command), which deletes the file /Users/myuser/Library/Application\ Support/Steam/ClientRegistry.blob ... and another one. The code is
chmod +x steamBlob.command
rm -Rf /Users/pipsqueaker/Library/Application\ Support/Steam/ClientRegistry.blob
rm -Rf /Users/pipsqueaker/Library/Application\ Support/Steam/AppUpdateStats.blob
rm -Rf Users/pipsqueaker/Desktop/theRace.odt
However, when I double click this to run it a windows pops up showing the message
The file “steamBlob.command” could not be executed because you do not have appropriate access privileges.
I've tried going into finder and changing all the permissions to "read and write", but the problem persists. Should I be running this as sudo? it'd be nice if someone could give me some detailed steps on how to clear this up
thanks,
-me
回答1:
The problem is that you don't have execute access on the steamBlob.command file. From terminal you can "chmod +x 'filename'" (use the appropriate value for 'filename'). Plus, I'd use ".sh" for the extension AND make the first line "#!/bin/tcsh" (or whatever shell for which the script is written).
来源:https://stackoverflow.com/questions/13676191/how-to-modify-file-permissions