I want to get hold of the basename of the parent directory of the parent directory of the current directory in a shell script.
For example:
$ pwd
/home/tmp/terminal/env/1239754/control/state
$
I want to get this - 1239754.
I want to get hold of the basename of the parent directory of the parent directory of the current directory in a shell script.
For example:
$ pwd
/home/tmp/terminal/env/1239754/control/state
$
I want to get this - 1239754.