I have a list of paths stored in a bash variable, such as the following
>>> MY_PATHS= ../Some/Path/ ../Some/Other/../Path/
I'd like to have a list of unique relative paths, but due to the ".." parent directory used in the second path I can't just pipe these to uniq
.
Is there a standard linux way to normalize directory paths?
My desired result is this:
>>> echo $MY_UNIQUE_PATHS
../Some/Path/