Stock script problems


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Stock script problems
# 1  
Old 05-23-2006
Stock script problems

I'm have some trouble, I'm doing some unix stuff for fun and I can't get something to work

I have a getquote.sh script:
wget "http://finance.yahoo.com/q?s=$1" -o /dev/null -O quote
echo `echo $1; egrep "Last Trade:" quote | cut -d ">" -f 3 | cut -d "<" -f 1`

to get the current trading price and I have a portfolio file with the ABBR, price and shares like:
GOOG 300.00 100

I want to get just the first word so I can send the abbr to the getquote.sh script so I did:

gawk '{ print $1 }' portfolio | ./getquote.sh

which should output something but it prints nothing. If I just do the gawk part it will output all the of abbrs in the first column of the file correctly, and the ./getquote.sh GOOG by itself will return the correct output but I can't seem to get them to link up right. Ideas?
# 2  
Old 05-24-2006
do this

Put the command getting the first word into the script itself.
Inside the script,
Code:
gawk '{ print $1 }' portfolio | while read line
do
 ./getquote.sh $line
done

 
Login or Register to Ask a Question

Previous Thread | Next Thread

2 More Discussions You Might Find Interesting

1. What is on Your Mind?

Did You Buy any Facebook IPO Stock at $38 a share?

Big day for FB. Did anyone manage to buy any of the IPO stock before the bell? (17 Replies)
Discussion started by: Neo
17 Replies

2. UNIX for Dummies Questions & Answers

What exactly is Stock Bit (t)

(yes i read the man page for chmod) and i did a basic search on the web. but it never really went into any info on it. the reason i ask is. when my systems receaves an email @ at certer user it has a specific mailer specified and that mailer writes stuff to /tmp well the orig. perms were... (3 Replies)
Discussion started by: Optimus_P
3 Replies
Login or Register to Ask a Question