On Wed, Apr 13, 2011 at 03:34:41PM -0400, Bob Goodwin wrote:
> I would like to write a script to extract two numbers from the following
> xml file:
There are *so* many ways to do this; one brute-force approach:
Put the following two commands in a file; let's call it "foo":
grep "Actual Usage Download" foo | sed -e "s/^.*value=\"//" -e "s/\" .*$//"
grep "Actual Usage Upload" foo | sed -e "s/^.*value=\"//" -e "s/\" .*$//"
Make the file executable:
chmod a+rx foo
Then, if your XML file is named bar.xml:
foo <bar.xml
(If the file isn't in your path, "./foo", etc.)
Cheers,
--
Dave Ihnat
[email protected]
--
users mailing list
[email protected]
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines