MacOS – Permission denied for symbolic link

applescriptmacospermissionsymlinkterminal

I'm creating a symbolic link with the following applescript:

on run
    do shell script "rm /usr/bin/ant" with administrator privileges
    do shell script "ln -s /Users/hordine/software/apache-ant-1.8.2/bin/ant /usr/bin/ant" with administrator privileges
end run

The symbolic link is created but when I try to execute ant -version from a terminal window, I get a permission denied error.

How can I create this link so that I DO have permission to execute it later?

Best Answer

Do a chmod on the symlink to give you the rights.

do shell script "chmod 755 /usr/bin/ant" with administrator privileges