Skip to main content

Posts

Showing posts with the label Shebang

Shebang...... an magic of unix

Hello, Thanks for visiting RvKmR.blogspot.in In this post, I am going to explain about shebang line. We see many of script starts with #! special characters. We are aware of # as a comment but at the start of the script if we use #! then it is not an ordinary comment. It is an instruction to program exec which execute our script. The shebang #! is humanly readable instance of a magic number consisting of the byte string 0x23 0x21. This is passed to exec() to determine the file to be executed is a script or a binary. When shebang line #! is used exec runs the script with executable specified after shebang #!. Ex. #!/bin/bash This is an instruction to exec to start execution of the program with /bin/bash.