Code: currency_convert() { curl -s "http://www.google.com/finance/converter?a=$1&from=$2&to=$3" | sed '/res/!d;s/<[^>]*>//g'; } Usage: $ currency_convert 1 usd eur $ currency_convert 0.003 usd pkr Source