The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
SCO stock plummets on Unix verdict - Computing iBot UNIX and Linux RSS News 0 08-13-2007 05:10 PM
SCO stock plummets on Unix verdict - VNUNet.com iBot UNIX and Linux RSS News 0 08-13-2007 04:50 PM
What exactly is Stock Bit (t) Optimus_P UNIX for Dummies Questions & Answers 3 08-10-2001 09:20 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-23-2006
Registered User
 

Join Date: May 2006
Posts: 1
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
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?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-23-2006
Playing with Ubuntu Now!
 

Join Date: Oct 2005
Location: Chennai
Posts: 363
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
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
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:56 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101