I’m trying to write a simple AppleScript application that will “do shell script” to move some files and change some permissions. Here is what I have done…
#!/bin/sh
cp /beachballfolder/beachball /usr/local/bin
The problem is that when I run the Applescript I get a permission denied error. If I do this from the terminal with a sudo in front of the cp it works fine.
So is there some command I can place in front of the cp in the shell script to act like sudo? I tryed to just put sudo there and got a error. Rookie move I guess, but when your a greenhorn you will try anything.
The permissions on the /usr/local/bin directory should allow you to cp directly to it without using sudo. Check the permissions on the /usr/local/bin directory, mine are…
drwxr-xr-x
Also, make sure you are using the filenames extension, if it has one, eg., beachball.txt
Andrew, my /usr/local/bin is owned by my user name…
%/usr/local/;ls -al
drwxr-xr-x 99 greg unknown 3366 Oct 14 22:47 bin/
I ran repairPermissions yesterday, and I don’t know why, or how, my group got set to “unknown”. I’ve never changed it myself, maybe some application installer did something???