How to execute a script in C?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • snowball179
    Confirmed User
    • Dec 2002
    • 261

    #1

    How to execute a script in C?

    I need to execute a file named toplist (there is no extension) on my web server. I think that it is in C.

    How do I execute it?

    Thanks!
  • snowball179
    Confirmed User
    • Dec 2002
    • 261

    #2
    I also need to execute a file named toplist.sh

    Anyone knows how?

    Comment

    • lustbin
      Registered User
      • Feb 2003
      • 83

      #3
      system("command line here");

      http://www.cs.utah.edu/dept/old/texi...14.html#SEC213

      for further info and alternate methods
      cube life got me down
      icq# 21315507

      Comment

      • TrafficTeam
        So Fucking Banned
        • Oct 2002
        • 106

        #4
        got SSH access to your box?


        Rgds,JOKER

        Comment

        • snowball179
          Confirmed User
          • Dec 2002
          • 261

          #5
          Originally posted by TrafficTeam
          got SSH access to your box?


          Rgds,JOKER
          yes

          Comment

          • TrafficTeam
            So Fucking Banned
            • Oct 2002
            • 106

            #6
            then make sure its executeable,you have the rights to execute it and type (inside the folder where the script is)


            ./scriptname


            for the .sh script either:

            ./scriptname.sh

            or:

            sh scriptname.sh



            Rgds,JOKER

            for any further questions pls hit me up on ICQ,I'm not refreshing every 5 minutes here...

            Comment

            • lustbin
              Registered User
              • Feb 2003
              • 83

              #7
              hmm no more drinking while answering questions

              chmod 2 tha res-q
              cube life got me down
              icq# 21315507

              Comment

              • res
                Confirmed User
                • Nov 2002
                • 1118

                #8
                For C scripts:
                1) gcc -o target source.c
                2) ./target

                For Shell scripts:
                1) Add header in your shell script: #!/bin/sh
                2) chmod 755 filename.sh
                3) filename.sh

                Comment

                Working...