You can think about it as simplifying of the first argument "cd" command (a standart bash command). Simplifying means making shorter.
For instance if I do
it works the same as
. Which means "b" is simplifying of "a/../b". It is much easier to explain everything using examples.
Input: String. Non-Empty valid unix path.
Output: String. Unix path.
# last slash is not important simplify_path('/a/')...