From 6eb836dd44aa7452228d1f5e059aa99cd761d40e Mon Sep 17 00:00:00 2001 From: cLupus Date: Sun, 1 Oct 2017 23:40:06 +0200 Subject: [PATCH] fix: Useing 'type' instad of 'which', which is more robust For reference, see: https://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script. --- plugins/rand-quote/rand-quote.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/rand-quote/rand-quote.plugin.zsh b/plugins/rand-quote/rand-quote.plugin.zsh index 8f345d9aa..03a93cecc 100644 --- a/plugins/rand-quote/rand-quote.plugin.zsh +++ b/plugins/rand-quote/rand-quote.plugin.zsh @@ -10,7 +10,7 @@ TEXT_COLOR="\e[0;35m" COLON_COLOR="\e[0;35m" END_COLOR="\e[m" -if [[ -x `which curl` ]]; then +if $(type curl > /dev/null); then function quote() { Q=$(curl -s --connect-timeout 2 "http://www.quotationspage.com/random.php3" | iconv -c -f ISO-8859-1 -t UTF-8 | grep -m 1 "dt ")