• We did not send an email asking for donations - please read this post.

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......
 


wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
7,790
Reaction score
6,615
Credits
28,677
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
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Staff online

Members online


Top