ANDREAS SCHIPPLOCK
Programmer, Linux user since ~2000.


Positional Parameters

A simple example:


#!/bin/bash
echo ${0}
Print the first positional parameter which is the scripts own name.

Another example:


#!/bin/bash
echo ${1}
This will print the second positional parameter.

Save this as "test.sh", "chmod +x test.sh" and call it like:


./test.sh foo
It will print "foo" to your console.