I assume that it hangs because you have a number of HTTP requests being sent to a single host in a script. The host in question doesn't like that too much and it starts to block requests from your IP address.
A simple workaround would be to put a sleep
in between the requests. You could also make use of a function:
getExchangeRates() {
wget -qO- "http://www.google.com/finance/converter?a=1&from=usd&to=$1" | sed '/res/!d;s/<[^>]*>//g' >> exrates
sleep 10 # Adding a 10 second sleep
}
and invoke it by passing a parameter to the function:
getExchangeRates aud
The function could also be invoked in a loop for various currencies:
for currency in aud jpy hkd nzd eur gpb; do
getExchangeRates $currency
done