Created
April 19, 2019 13:55
-
-
Save mkhl/a00a3f358233686c3964049f86c2eb4b to your computer and use it in GitHub Desktop.
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/zsh | |
# Usage: realpath [<path>...] | |
# Print each real absolute <path>, resolving symlinks | |
# Defaults: <path>: read from stdin | |
case $# in | |
0) | |
while read path; do | |
echo "${path:A}" | |
done | |
;; | |
*) | |
for path; do | |
echo "${path:A}" | |
done | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment