student

New Member
Joined
Nov 28, 2018
Messages
2
Reaction score
0
Credits
0
if linux systems will not consider anything after # sign in the scirpt, then how come #!/bin/bash works??
#!/bin/bash starts with # sign it shouldn't be consider right??but if the #!/bin/bash is not included in the scirpt its not working??? explain me pls......
 


G'day @student and welcome to linux.org :)

Google reveals

MhUg4Cr.png



SCREENSHOT 1 - GOOGLE SEARCH


You may be aware that there are a number of different Shells, the Bourne Again SHell (bash) being just one of them.

https://www.howtogeek.com/68563/htg-explains-what-are-the-differences-between-linux-shells/

#!/bin/bash

... is called "the shebang". Its "syntax" ie structure acts as a flag to other programs and parts of Linux that we are about to run a Bash script.

The shebang is like a Header for the script.

Once into the body of the script, # acts to indicate a comment. It can be used for multiple lines of comments.

Chris Turner
wizardfromoz
 

Members online


Latest posts

Top