In a bash script, I want to extract the 2 last folders of the pwd.
I did this :
value=`pwd`
echo "you are here : $value"
echo "the folder is: ${value##*/}"
To have this :
you are here: /home/user/folder1/folder2
the folder is folder2
Now I want to extract the parent folder (folder1).