Hi guys
I have variable that contains a full directory path.
var=/tmp/a/b/c/d
I want to be able to extract different directories in the path right to left while using / as the delimiter.
so for e.g. if in the above example if I want c then I want it to be in the middle of 1st and second / rather than 4th and 5th.
and if I want to extract do then it would be right of the first / .
If possible please post the full command rather than just suggesting a switch to use.
many thanks
ali