What is she-bang and why do we call it that??
What is she-bang?
she-bang or sh-bang are the first 2 characters of a line,
indicating to the OS that a command interpreter is needed.
These 2 characters make up a magic number, typically used in shell scripts
and some other programs that require a command interpreter. Immediately
following the she-bang is a path to the required interpreter.
The # character, which is normally used to denote comments, make the
she-bang line itself invisible to the interpreter.
Why do we call it that?
The # character is sometimes called sharp (sh-arp) or hash (ha-sh)
and the exclamation point is sometime called a bang for short. sh-bang or she-bang.
Typical usage:
#!/bin/bash or #!/bin/env bash
Most any shell and many interpreters can be called out this way.
Welcome to the world of Linux scripting![]()
A very important line for all Linux scripts. Without it, you won't go far! +rep
thanks for the +rep
Yes it's very important.
When i first started using linux (many years ago),
I heard the term she-bang a few times and it wasn't
until a months later that I actually learned what it meant.
Linux newbies have a whole new vocabulary to learn,
so simple explanations sometimes help.![]()
The magic number #! has another mean in kernel?
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
You may be referring to file and character set identification which was discussed a few weeks ago.
If so see link: Detect Character Set
We <3 William Hung![]()
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks