X-Git-Url: http://id.pley.net/dotfiles.git/blobdiff_plain/5a2aa4d6a19afcbc19ced19b67d2ad4f99b9de5a..f4e318ead195f190703dc8b02ef45f8d7d0f4d2d:/zsh_aliases diff --git a/zsh_aliases b/zsh_aliases index f330702..05e1a10 100644 --- a/zsh_aliases +++ b/zsh_aliases @@ -22,6 +22,7 @@ alias p='ps -au' alias tf='tail -25f' alias l='ls -lF' alias la='ls -laF' +alias less='less -R' alias clr='clear' alias cls='clear' alias d='date' @@ -67,10 +68,23 @@ if [[ $( has pidof ) == 'no' ]]; then fi function ssh-forget() { - sed -i "" "/^$1,/d" ~/.ssh/known_hosts + sed -i "" "/^$1[, ]/d" ~/.ssh/known_hosts } function ssh-learn() { - sed -i "" "/^$1,/d" ~/.ssh/known_hosts + 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 +} + +function sayStatus () { local _status=$?; if [[ $_status -eq 0 ]]; then say "Success"; else say "Failed"; fi; return $_status }