Bash script get own path and name

pathfile.bash

#!/bin/bash

# Full path to file
echo "$(cd "$(dirname "$0")"; pwd)/$(basename "$0")"

# Full path of the directory the file is in with trailing slash
echo "$( cd "$(dirname "$0")" ; pwd -P )/"