From 6f719aab1a2b0854bb026f9df312a29ec8aff630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 23 Jun 2015 21:16:03 +0300 Subject: [PATCH] Get rid of dependency on "which" --- cdiff.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cdiff.sh b/cdiff.sh index e88bf06..f5b606a 100755 --- a/cdiff.sh +++ b/cdiff.sh @@ -2,7 +2,7 @@ # cdiff.sh - Convenience wrapper for colordiff # -# Copyright (C) 2003-2009 Ville Skyttä +# Copyright (C) 2003-2015 Ville Skyttä # Based on cdiff version 1.4 by eivind@FreeBSD.org # # This program is free software; you can redistribute it and/or @@ -30,15 +30,15 @@ case `echo "$file" | perl -ne 'print lc $_'` in http:*|https:*|ftp:*) if [ -z "$CDIFF_FETCH" ]; then - if which curl >/dev/null 2>&1; then + if type curl >/dev/null 2>&1; then CDIFF_FETCH="curl -s" - elif which wget >/dev/null 2>&1; then + elif type wget >/dev/null 2>&1; then CDIFF_FETCH="wget -e timestamping=off -qO -" - elif which lwp-request >/dev/null 2>&1; then + elif type lwp-request >/dev/null 2>&1; then CDIFF_FETCH="lwp-request -m GET" - elif which lynx >/dev/null 2>&1; then + elif type lynx >/dev/null 2>&1; then CDIFF_FETCH="lynx -source" - elif which elinks >/dev/null 2>&1; then + elif type elinks >/dev/null 2>&1; then CDIFF_FETCH="elinks -source" fi if [ -z "$CDIFF_FETCH" ]; then