Skip to content

Instantly share code, notes, and snippets.

@mkhl
Created April 19, 2019 13:55
Show Gist options
  • Save mkhl/a00a3f358233686c3964049f86c2eb4b to your computer and use it in GitHub Desktop.
Save mkhl/a00a3f358233686c3964049f86c2eb4b to your computer and use it in GitHub Desktop.
#!/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