From a12d8dfd6fd9b49029de9dc9d67cb05749b51901 Mon Sep 17 00:00:00 2001 From: Jer Noble Date: Tue, 9 Apr 2013 17:41:15 -0700 Subject: [PATCH 1/1] Make pidof definition more x-platform-y. --- zsh_aliases | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.40.1