Table of contents
What is Shell Scripting?
A shell script is a computer program designed to be run by a Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing text.
What is #!/bin/bash
&#!/bin/sh
?
#!/bin/bash
and #!/bin/sh
are called "Shebangs".
#!/bin/bash
specifies that the script should be interpreted and executed using the Bash shell (Bourne Again Shell). Bash is a popular and feature-rich shell commonly found on Linux and Unix-based systems. When you use #!/bin/bash
as the shebang, you can take advantage of all the advanced features and functionalities that Bash offers.
#!/bin/sh
specifies that the script should be interpreted and executed using the default shell of the system. On most Linux and Unix systems, this points to the Bourne shell (sh), or a compatible shell such as the POSIX-compliant shell.