Gentoo Archives: gentoo-user

From: "A. Khattri" <ajai@××××.net>
To: gentoo <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] Bash + Awk + variable assignation.
Date: Tue, 20 Sep 2005 17:41:44
Message-Id: Pine.BSO.4.58.0509201327230.9471@ida.bway.net
In Reply to: [gentoo-user] Bash + Awk + variable assignation. by Ow Mun Heng
1 On Tue, 20 Sep 2005, Ow Mun Heng wrote:
2
3 > Remember my script that sends out HTML emails? Well, that's done, but
4 > it's in-efficient.
5 >
6 > The actual script that parses screen-scrapes. Initial script only went
7 > to get the "Last Price" now, I would like to add the "Day Range"
8 >
9 > last_price()
10 > {
11 > value="$(lynx -dump "$url$symbol" | grep 'Last price:' | \
12 > awk -F: 'NF > 1 && $(NF) != "N/A" { print $(NF) }' )"
13 > }
14 >
15 > day_range()
16 > {
17 > day_range="$(lynx -dump "$url$symbol" | grep 'Low \& High:' | \
18 > awk -F: 'NF > 1 && $(NF) != "N/A" { print $(NF) }' )"
19 > }
20 >
21 > The above is in-efficient because I need to call the script to get the
22 > page 2 times.
23
24 Err... what were you saying about perl being hard...?
25
26 (At some point, your shell script will become so convoluted that perl
27 or python will look easy ;-)
28
29
30 --
31
32 --
33 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Bash + Awk + variable assignation. gentuxx <gentuxx@×××××.com>
Re: [gentoo-user] Bash + Awk + variable assignation. Billy Holmes <billy@××××××.net>