• 0 Posts
  • 4 Comments
Joined 1 year ago
cake
Cake day: July 15th, 2023

help-circle



  • As far as I recall and for Linux, the shebang is interpreted by the kernel to execute the text file as the input of a given program. Are you talking about adding a shebang to a C source file? If so, this would not work, because the hash could be interpreted as a preprocessor instruction.

    Take into consideration that, in bash, you can use ${0} to get the filename of the current script. If you want the count of lines in your script wc -l ${0} ought do the trick.

    If you’re using C, you could rely on the FILE define for your imolementation but the rest implies reading the source code and then acting on it.