Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ooagentbender

macrumors member
Original poster
Dec 21, 2002
53
0
Ok terminal is the flippin bomb, BUT I can't make my own executable scripts for the life of me because
1 I can't coppy a new file to the bin folder cause its protected and
2 because for some reason when I use set PATH=/bin2:$PATH it doesn't add it in there with the rest of them

HELP!

im sick of having to cd to the mysql folder and type in a bunch of crap to open the server and compile PHP on it.

PS I did the chmod 755 to the file I want to execute

Thanks
 

Doctor Q

Administrator
Staff member
Sep 19, 2002
39,789
7,525
Los Angeles
1. The way you set your PATH depends on which shell you are in. Type echo $SHELL to find out for sure. If you are using the tcsh shell or the C shell then you want to type either setenv PATH /bin2:$PATH or set path=(/bin2 $path) instead of PATH=/bin2:$PATH. If you want to know why there are two methods, I can give you more details.

2. Are you really talking about a folder named /bin2, or do you mean a bin2 subfolder of a mysql folder? In either case, you need the full pathname in your PATH, e.g., /bin2 or /Users/nibbler/bin2 or /usr/local/mysql/bin2 or whatever.

3. If you can't copy your script into a folder, you have three choices: (a) become a user who has permission to do the copy; (b) change the target folder permissions so you DO have permission to do the copy; (c) put the script somewhere that you DO have access to and set your PATH to use it.
 

Chimaera

macrumors regular
Nov 15, 2002
181
0
have you tried using sudo (or su if your mac has root enabled)?

if not type:

sudo cp <filename> <copy to location>

and it will prompt you for an admin pass
 

leprechaunG4

macrumors member
Feb 20, 2003
56
1
Like chimaera said, I think you need root privelage to write to the bin directory. So either sudo it or activate your roo accoutn and su
 

Doctor Q

Administrator
Staff member
Sep 19, 2002
39,789
7,525
Los Angeles
sudo and su may get the job done, but they may also be overkill. In the case of mysql, there is usually a dedicated user name (e.g., mysql) who owns the folders and files, so becoming that user makes more sense. There is also a hidden disadvantage in using root, which is that files you create may end up owned by root and inaccessible to the regular users who need them, so you have to remember to do chowns, chgrps, or chmods. I don't think we have enough details from ooagentbendero to decide.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.