You should have already looked at a Shell script with the first line starting with:
Well, the name given to this is Shebang (!#) and it is used to indicate which interpreter should read and execute the file. As was the case with Bash.
To use Shebang, we must include it in the first line of the file:
#!/bin/bash echo "Testing the interpreter"
To run this file, we need to assign execute permission to it:
$ chmod +x <file-name>
And now we run:
Note that we no longer need to say which interpreter will read and execute the file, as we already use Shebang.
./ Indicates that the file is in the current execution folder (
the period (
.) indicates the current folder and 2 points (
..) the parent
folder or 1 above.