X-Git-Url: http://id.pley.net/dotfiles.git/blobdiff_plain/5a2aa4d6a19afcbc19ced19b67d2ad4f99b9de5a..2ea666b3ad4c9f6a2e58c969385e8e391e325ae9:/zsh_aliases diff --git a/zsh_aliases b/zsh_aliases index f330702..1728fa3 100644 --- a/zsh_aliases +++ b/zsh_aliases @@ -74,3 +74,14 @@ function ssh-learn() { sed -i "" "/^$1,/d" ~/.ssh/known_hosts ssh-keyscan -t rsa $1 >> ~/.ssh/known_hosts } + +function canonicalize() { + local relpath=$( dirname $1 ) + if [[ ! -d "$relpath" ]]; then + echo "$0: no such file or directory: $1" + return 1 + fi + + echo $(cd $relpath; pwd -P)/$(basename $1) + return 0 +}