From: Jer Noble Date: Wed, 10 Apr 2013 00:41:15 +0000 (-0700) Subject: Make pidof definition more x-platform-y. X-Git-Url: http://105106.c2e0p.group/dotfiles.git/commitdiff_plain/a12d8dfd6fd9b49029de9dc9d67cb05749b51901?ds=inline Make pidof definition more x-platform-y. --- diff --git a/zsh_aliases b/zsh_aliases index 80f9c85..dae48a8 100644 --- a/zsh_aliases +++ b/zsh_aliases @@ -52,7 +52,7 @@ 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); } -if [[ $(/usr/bin/which -s pidof) -eq 0 ]]; then +if [[ $(which pidof &> /dev/null; echo $?) -eq 1 ]]; then function pidof () { ps -e -o pid,comm | grep "$1" | awk '{print $1}'; } fi