STUPID TERMINAL! need help.....

Discussion in 'Mac Apps and Mac App Store' started by ooagentbender, Mar 4, 2003.

  1. ooagentbender macrumors member

    Joined:
    Dec 21, 2002
    #1
    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
     
  2. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #2
    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.
     
  3. Chimaera macrumors regular

    Joined:
    Nov 15, 2002
    #3
    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
     
  4. leprechaunG4 macrumors member

    Joined:
    Feb 20, 2003
    #4
    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
     
  5. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #5
    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.
     
  6. sparkleytone macrumors 68020

    sparkleytone

    Joined:
    Oct 28, 2001
    Location:
    Greensboro, NC
    #6
    edit your path declaration in the /etc/csh.login file. before you save it, make sure that it is all on one line.
     

Share This Page