If I have a file path such as...
/home/smith/Desktop/Test /home/smith/Desktop/Test/
How do I change the string so it will be the parent dir
dir=/home/smith/Desktop/Test parentdir="$(dirname "$dir")"
Works if there is a trailing slash, too.