#!/bin/sh
#

filename="/tmp/kabu.txt"
mysqlpass="hogehoge"

datej=`/bin/date +%Y%m%d`
timej=`/bin/date +%H%M%S`

#
# ANA
#
name="9202"
wget --quiet -O $filename "http://quote.yahoo.co.jp/q?s=9202.t"
nedan=`grep -a -A 1 chartbg $filename | \
sed -e s/" "//g | sed -e s/"<b>"/" "/g | \
sed -e s/"<\/b>"/" "/g | awk '{print $4}' | tail -1`

echo $name $nedan

/usr/local/bin/mysql kabu -u root --password=$mysqlpass -e \
"insert into toushin \
(bunrui,name,date,time,kagaku) values \
('KABU','$name',$datej,$timej,$nedan)"