Taco Steemers

A personal blog.

Articles tagged with bash

Notes on bash

"Bash is the GNU Project's shell—the Bourne Again SHell."

Script name, directory, present working directory

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#!/bin/bash

echo "Script name:"
echo "$BASH_SOURCE"
echo "$0"

echo "Directory that contains the currently running script, relative to PWD:"
echo "$(dirname …