5 Replies Latest reply: Jan 28, 2010 8:03 PM by V.K.
PauloGuedes Level 1 Level 1 (0 points)
i need to execut a shell script from the terminal. That SH script needs the SU permission. But when i try to SU and put my password it refuses it. What can i do to run my SH script?

greetings,
Paulo

MacBook Pro 15", Mac OS X (10.6.2), Model Identifier: MacBookPro2,2
  • V.K. Level 9 Level 9 (56,130 points)
    PauloGuedes wrote:
    i need to execut a shell script from the terminal. That SH script needs the SU permission.

    what do you mean?? if you mean you want to run it as root then run it with sudo.
    But when i try to SU and put my password it refuses it.

    what exactly are you putting in? su is the command to witch users. there is no need to do it and if you do do it it has to be done in a separate command. but if you want to run a script as root just enter

    sudo path/to/shellscript


    you'll have to enter your admin password (which you won't see). that's normal.

    Message was edited by: V.K.
  • PauloGuedes Level 1 Level 1 (0 points)
    Hello there,

    the usage of "sudo path/to/shellscript" answer with "Permission denied". How come?

    thank you,
    Paulo
  • V.K. Level 9 Level 9 (56,130 points)
    this depends on what your shell script is trying to do. can't say anything without seeing the details.
  • BobHarris Level 6 Level 6 (15,440 points)
    Chances are your script does not have the executable permission bit set.

    chmod +x your_script.sh
  • V.K. Level 9 Level 9 (56,130 points)
    BobHarris wrote:
    Chances are your script does not have the executable permission bit set.

    chmod +x your_script.sh

    of course! I should have thought of that...