Announcement

Collapse
No announcement yet.

[SOLVED] executing shell scripts

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] executing shell scripts

    Hi,

    I am running 9.10

    If I try to run a shell script (bash) in the current directory as root, I have to put the sh command before the script, for example:

    sh example.sh

    It will not run with solely typing:

    ./example.sh

    any help is greatly appreciated!

    #2
    Re: executing shell scripts

    Check to make sure that the script has execute permissions
    If not then set it
    Code:
    chmod u+x ./example.sh
    Then ./example.sh should work

    Comment


      #3
      Re: executing shell scripts

      Also, make sure that the first line of the script has a comment describing which shell is to be used to execute it -- for example
      Code:
      #!/bin/bash

      Comment


        #4
        Re: executing shell scripts

        heheh I forgot a / in front of bin resulting in:

        #!bin/bash

        durp!

        thx guys

        Comment


          #5
          Re: executing shell scripts

          Please edit the first post and mark the thread as [Solved]

          Comment

          Working...
          X