code: plan9front

ref: a14f9efa6848f167f54dea3e3823b31dae1461c9
dir: /rc/bin/stock/

View raw version
#!/bin/rc

stock=ALU

if(! ~ $#* 0) stock=`{echo $*|tr a-z A-Z|sed 's/ /+/g'}

hget 'http://download.finance.yahoo.com/d/quotes.csv?s='^$stock^'&f=snl1d1c1v&e=.exe' |
	sed 's/ +"/"/;s/
//' |
	switch(`{date}){
	case *'Apr 1 '*
		sed 's/("ALU","ALCATEL LUCENT"),([^,]*),(.*)$/\1,72.35,\3/'
	case *
		cat
	}