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

Neb Cross

macrumors newbie
Original poster
Oct 24, 2008
9
0
Hi Everyone :)

I am new to these forums so i hope i have got the correct category for this question.

anyway.....

I have just installed Apache Tomcat on my Mac (Version 10.5.5) an i am trying to put a simple script in my /usr/bin folder.

To do this i have been using this command in my terminal:
cp File /../../../usr/bin

but when i execute it, the terminal says :permission denied.

I would really appreciate any help with this matter.

Thanks,
-Neb
 
That's going to need a sudo. And as always...

Code:
 We trust you have received the usual lecture from the local System
 Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.
 
Hi again,

I have now got the script in the /usr/bin folder

but, now i have a slightly different problem. When i run the script i get the same error message:
-bash: /usr/bin/tomcat: Permission denied

This is the script that i have placed in the /usr/bin folder. To run the script i type tomcat start
Code:
#!/bin/bash

case $1 in
  start)
    sh /Library/Tomcat/bin/startup.sh
  ;;
  stop)
    sh /Library/Tomcat/bin/shutdown.sh
  ;;
  restart)
    sh /Library/Tomcat/bin/shutdown.sh
    sh /Library/Tomcat/bin/startup.sh
  ;;
  *)
    echo "Usage: start|stop|restart"
  ;;
esac

exit 0

Again your help would be greatly appreciated :)

Thanks,
-Ben
 
You need to do a chmod on the script file to give it executable permissions. For example, chmod 755 /usr/bin/ScriptFile. You may need to add a sudo before the chmod command to get the permissions needed to change the permissions.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.