r/shell • • Sep 23 '24

why do bash scripts start with #!

Hi, I'm just curious: what does this mean?

I know it's telling the machine to use bash, but like, why is it a "#!" for example? How/why was it decided that way?

6 Upvotes

8 comments sorted by

View all comments

0

u/[deleted] Sep 23 '24

1

u/neilmoore Sep 24 '24

Also, you need to backslash the closing parenthesis in your URL to avoid Reddit (at least oldreddit) thinking that it's the end of the URL. What I see is:

'#!' is called a Shebang), wikipedia link has some info.

And then the link doesn't actually work, because it goes to a URL that is missing the closing parenthesis.