This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# relpath -- Compute relative path from a given DIR to given PATHs | |
# Usage: relpath DIR PATH... | |
# | |
# Example: relpath /a/b/c /a/d/e/f | |
# prints: ../../d/e/f | |
# | |
# Example: relpath /a/b/c / | |
# prints: ../../../ | |
# |