Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Convert any currency via the command line' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Convert any currency via the command line
Authored by: powerbookg3user0 on Jul 07, '05 09:11:34PM
Hmmm… I can make it better ;)
#!/bin/tcsh -f

if($1 == -h) then
lynx -nolist -dump 'http://www.macosxhints.com/dlfiles/curr_units.txt'
else lynx -nolist -dump 'http://finance.yahoo.com/currency/convert?amt='$1'
&from='$2'&to='$3'&submit=Convert' | grep $2$3 | sed -e 's/[ ]*//' | awk '{print $6}'
endif
exit 0
Again, make sure the else line and the &from line have no break inbetween. This doesn't need a local file, but instead, lynxes it!

---
Takumi Murayama

[ Reply to This | # ]