setting ACL permissions via script


I am getting an error and I don’t know how to get around it.

I need to set an Access List on OSX server like this;

chmod +a “drfoo allow list,add_file,search,delete,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown,file_inherit,directory_inherit” drfoo

In my script, I don’t know how to handle the quotes " "'s

typically i would
do shell script " something "
in this case I have
do shell script " " <— thats not right. how can iget around this ?


I don’t actually understand your example so I use a different one :wink:
Asssuming you want to list the root directory on your external volume “my external HD”
you will type in Terminal

ls "/Volumes/my external HD"

In AppleScript you can either use single quotes

do shell script "ls '/Volumes/my external HD'"

or escape the double quotes (with a backslash, which also must be escaped with a backslash)

do shell script "ls \\"/Volumes/my external HD\\""

or just escape the space characters

do shell script "ls /Volumes/my\\ external\\ HD"

or use the built-in quoted form keywords

set myVol to "/Volumes/my external HD" do shell script "ls " & quoted form of myVol