Skip to Content
Learn Linux Shell Scripting - Fundamentals of Bash 4.4
book

Learn Linux Shell Scripting - Fundamentals of Bash 4.4

by Sebastiaan Tammer
December 2018
Beginner
452 pages
12h 17m
English
Packt Publishing
Content preview from Learn Linux Shell Scripting - Fundamentals of Bash 4.4

The shebang

You are probably wondering about that first line. The second (or third, if you count the empty line) should be clear, but that first one is new. It is called the shebang, but is sometimes also referred to as a sha-bang, hashbang, pound-bang, and/or hash-pling. Its function is pretty simple: it tells the system which binary to use to execute the script. It is always in the format of #!<binary path>. For our purposes, we will always use the #!/bin/bash shebang, but for Perl or Python scripts it would be #!/usr/bin/perl and #!/usr/bin/python3 respectively. It might seem unnecessary at first sight. We create the script named hello-world.sh, whereas a Perl or Python script would use hello-world.pl and hello-world.py. Why, then, do ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Bash Scripting Fundamentals

Bash Scripting Fundamentals

Sander van Vugt

Publisher Resources

ISBN: 9781788995597Supplemental Content