diff --git a/cryptocurrency/cryptocurrency b/cryptocurrency/cryptocurrency index cc585a8..6bd0d8b 100755 --- a/cryptocurrency/cryptocurrency +++ b/cryptocurrency/cryptocurrency @@ -166,7 +166,7 @@ convertCurrency() { exchangeTo=$(echo "$exchangeTo" | tr '[:upper:]' '[:lower:]') exchangeRate=$(httpGet "https://api.coinmarketcap.com/v1/ticker/$reqId/?convert=$exchangeTo" | grep -Eo "\"price_$exchangeTo\": \"[0-9 .]*" | sed s/"\"price_$exchangeTo\": \""//g) > /dev/null - if ! command -v bc; then + if ! command -v bc &>/dev/null; then exchangeRate=$(echo $exchangeRate | grep -Eo "[0-9]*" ) exchangeAmount=$(( $exchangeRate * $amount )) else diff --git a/currency/currency b/currency/currency index b376418..ff48df4 100755 --- a/currency/currency +++ b/currency/currency @@ -137,13 +137,13 @@ checkInternet() convertCurrency() { exchangeRate=$(httpGet "http://api.fixer.io/latest?base=$base&symbols=$exchangeTo" | grep -Eo "[0-9]*[.][0-9]*") > /dev/null - if ! command -v bc; then + if ! command -v bc &>/dev/null; then exchangeRate=$(echo $exchangeRate | grep -Eo "[0-9]*" ) exchangeAmount=$(( $exchangeRate * $amount )) else exchangeAmount=$( echo "$exchangeRate * $amount" | bc ) fi - + cat <