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.
This commit is contained in:
cLupus 2017-10-01 23:40:06 +02:00 committed by GitHub
parent accdcb2f1c
commit 6eb836dd44

View File

@ -10,7 +10,7 @@ TEXT_COLOR="\e[0;35m"
COLON_COLOR="\e[0;35m" COLON_COLOR="\e[0;35m"
END_COLOR="\e[m" END_COLOR="\e[m"
if [[ -x `which curl` ]]; then if $(type curl > /dev/null); then
function quote() 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 ") 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 ")