This repository has been archived by the owner on Jun 15, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get the deepest common path of any number of directories.
Currently doesn't normalize input paths, so the following fails (although it will match if the repeating slashes are equal): test "$(path_common /foo/bar //foo//bar//baz; echo x)" = /foo/barx Successful tests: test "$(path_common /a/b/c/d /a/b/e/f; echo x)" = /a/bx test "$(path_common /long/names/foo /long/names/bar; echo x)" = /long/namesx test "$(path_common / /a/b/c; echo x)" = /x test "$(path_common a/b/c/d a/b/e/f ; echo x)" = a/bx test "$(path_common ./a/b/c/d ./a/b/e/f; echo x)" = ./a/bx test "$(path_common $'\n/\n/\n' $'\n/\n'; echo x)" = $'\n/\n'x test "$(path_common --/-- --; echo x)" = '--x' test "$(path_common '' ''; echo x)" = x test "$(path_common /foo/bar ''; echo x)" = x test "$(path_common /foo /fo; echo x)" = x test "$(path_common $'--$`\! *@ \a\b\e\E\f\r\t\v\\\"\' \n' $'--$`\! *@ \a\b\e\E\f\r\t\v\\\"\' \n'; echo x)" = $'--$`\! *@ \a\b\e\E\f\r\t\v\\\"\' \n'x
- Loading branch information