.c to .sh file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prachi narayan
    New Member
    • Mar 2012
    • 1

    .c to .sh file

    v have made a program in text editor in ubuntu with .c xtension(means, a c programme) but we need to submit our result as .sh file(to be run with normal user permissions). being new to ubuntu, i don't knw nything about the steps required. if u know nything about it, pls help us out.
  • no2pencil
    New Member
    • Mar 2012
    • 4

    #2
    The problem is that these are two different languages. A c file by itself does not execute. It must first be compiled into a binary executable, which is then able to run. The .c file is the source code file & is human readable. The binary executable file that is created by the compiler is not human readable. A .sh file on the other hand is a script, & is executable by the shell (one given the correct file permission). It is an interpreted language, unlike the .c file which is compiled. This means two things, 1 the script must be run by the shell (the interpreter) & 2 it is executed line by line.

    Now, with all of that technical background out of the way, what I think you may need to do is call a .sh file to execute your binary file from the .c file. Or possible you may need to compile the .c file with a .sh shell script. You may want to check with your instructor as to what is required, because the way in which you have asked here doesn't make sense as it isn't possible because of the two different technologies.

    Comment

    Working...