Unix-C-Running-thereof

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sitko
    New Member
    • Sep 2007
    • 140

    Unix-C-Running-thereof

    Hi,

    I know this is a stupid question, but is there any special trick to running a C program on a Unix machine, after I've made (make)d it already? I've not touched this code for several months, and now I need to run it from a shell script, and for the life of me, I can't figure out if there was anything else I need to include with the call to the C program. I have:

    Code:
    #! /bin/sh
    C_Program input.txt
    echo done
    In a shell script called "RunProgram " that I activate with:
    ./RunProgram.sh

    But, this errors out.

    Thanks,
    Sitko.
  • mac11
    Contributor
    • Apr 2007
    • 256

    #2
    Maybe you need to include the path to your program when you execute it? I don't know otherwise - what error do you get?

    Comment

    • sitko
      New Member
      • Sep 2007
      • 140

      #3
      I'm not sure how I did it, but I got it to work...

      I added "/bin/sh ./"<shell script> and that seemed to do the trick.

      Thanks.

      Comment

      • Laharl
        Recognized Expert Contributor
        • Sep 2007
        • 849

        #4
        Yeah, shell scripts are run with 'sh ./scriptname.sh' or '/bin/sh ./scriptname.sh'.

        Comment

        Working...