X-Git-Url: http://id.pley.net/dotfiles.git/blobdiff_plain/a12d8dfd6fd9b49029de9dc9d67cb05749b51901..4fda9c133d174a4cddb03b4a2f03694e77ec1a77:/zsh_aliases?ds=sidebyside diff --git a/zsh_aliases b/zsh_aliases index dae48a8..f330702 100644 --- a/zsh_aliases +++ b/zsh_aliases @@ -51,8 +51,18 @@ function viw () { vi $(which $1); } function toss () { mv -f $@ ~/.trashcan; } function xcopy () { tar cvf - -C $1 $1/* | tar xvf - -C $2; } function checkdns () { ping $( grep nameserver /etc/resolv.conf | awk '{print $2}' | head -1); } +function has () { + which $1 &> /dev/null + if [[ $? -eq 0 ]]; then + echo 'yes' + return 0 + else + echo 'no' + return 1 + fi +} -if [[ $(which pidof &> /dev/null; echo $?) -eq 1 ]]; then +if [[ $( has pidof ) == 'no' ]]; then function pidof () { ps -e -o pid,comm | grep "$1" | awk '{print $1}'; } fi