I would like a variable available my bash shell similar to pwd
but equal to a section of the current working directory, rather than the whole path.
i.e.,
$PWD=/a/b/c/d/e/f
$PATH_SECT=c/d/e
I have a prompt that displays this path already, but I would like to update a variable in the environment to this value each time I change directory.
How could I do this?