Bash Shell Scripting
Crash Course
crowfly.net

<<   >>

Introduction

GNU_Tools

Example1

Example2

Execution_bit

Bang_bin_bash

Example3

The_dot

Example4

Example5

Example6

Example7

Example8

Background

Forking

Example9

Bash_profile

Pattern_match

Regex

Debug

Gory_details

References

<<   >>
Pound Bang Bin Bash

What is up with that first line in the program?

  #!/bin/bash

It is magic.

The Pound Sign (#) is a comment.

The Bang (!) as the first character in comment, as first line tells the interpreter what shell to use to interpret the script.

Here you can find any shell script interpreter, such as these:

  #!/bin/ksh

  #!/bin/csh

  #!/usr/bin/perl -w

  #!/usr/bin/php

Alternatively, you can specify the shell on the command line. However, the one in the Pound Bang will override it:

  dlink@viddev1> /bin/bash talk.sh

Or simply:

  dlink@viddev1> bash talk.sh