#!/bin/bash b="$(basename "$0")" d="$(cd $(dirname "$0"); pwd)" f="$d/$b" echo "basename is $b" echo "dirname is $d" echo "fullname is $f"