Loosing price variable only when assigning to variable name



I have a very simple script that is just suppose to extract the price
from an html page. Seems easy...but it's giving me a headache. Script
below...

This is what seems like it should work to me... But all it does is
output a blank line with no data.
---------------------------------
#!/bin/bash -e

find . -name "test.html" | while read line;

do
PRICE=`egrep -o -m 1 '\$[0-9]+\.[0-9][0-9]' $line`;

echo $PRICE;
done
----------------------------------


You might think that the egrep is not working, but if I change it to
the following, it works! It only seems to loose the data when I assign
it to a variable name, as in the first example.
---------------------------------
#!/bin/bash -e

find . -name "test.html" | while read line;

do
egrep -o -m 1 '\$[0-9]+\.[0-9][0-9]' $line;
done
----------------------------------

I thought it may have something to do with the "$" in the price
variable trying to be echoed, so I piped it through sed to remove it
from the string before assigning, still with no luck.

Here is what is contained in "test.html"
----------------------------------
<b>Price: </b></font><font face="arial" size=2
color=cc0000>$797.90</font></td></tr>
----------------------------------

Any help someone can provide would be great!!! I don't pretend to know
if all but I thought I was better than this!

.



Relevant Pages

  • Re: Run a PHP script in background of a Site in every 10 Seconds
    ... Is there a code to be embedded in every php page so that the script ... times in those 2 minutes - and he wanted the price after the first event. ... " But as we are making a virtual market there are no RSS feeds. ...
    (comp.lang.php)
  • Re: Run a PHP script in background of a Site in every 10 Seconds
    ... Is there a code to be embedded in every php page so that the script ... times in those 2 minutes - and he wanted the price after the first event. ... the op indicated this is a stock trading simulator. ...
    (comp.lang.php)
  • Re: Run a PHP script in background of a Site in every 10 Seconds
    ... Is there a code to be embedded in every php page so that the script ... The problem with that is that a stock might have risen or fallen 12 ... times in those 2 minutes - and he wanted the price after the first event. ...
    (comp.lang.php)
  • Re: Run a PHP script in background of a Site in every 10 Seconds
    ... Is there a code to be embedded in every php page so that the script ... the server in order to access the Internet and update the database. ... times in those 2 minutes - and he wanted the price after the first event. ...
    (comp.lang.php)
  • Re: Prescriptions in Europe
    ... There is no difference in price; either the pharmacist gives you your ... I have visited 3 pharmacists, ... and the price without a script has always been the same (a bit over 20 ... has been very small, around 2 euro. ...
    (rec.travel.europe)

Loading