Simplify Unix Path2 Simplify Unix Path2
English

Simplify a give path

Input: String. Unix path.

Output: String. Unix path.

Example:

simplify_path('/a/') == '/a'
simplify_path('/a/b') == '/a/b'
simplify_path('/a//b/c') == '/a/b/c'
simplify_path('/a/b/./ci') == '/a/b/ci'
simplify_path('/a/b/../c') == '/a/c'