I want to transform /foo/bar/..
to /foo
Is there a bash command which does this?
Edit: in my practical case, the directory does exist.
I want to transform /foo/bar/..
to /foo
Is there a bash command which does this?
Edit: in my practical case, the directory does exist.