next up previous contents
Next: $1 $2 $3 ... Up: Parameters and the Shell Previous: Parameters and the Shell

$0: The Name of the Invoking Command

The special variable $0 represents the name of the executing program. The following shell, if called script.sh would output This program is called script.sh.:

    #!/bin/sh
    echo This program is called $0.
    exit 0



Claude Cantin
Sun Sep 1 02:02:26 EDT 2002