The shell is not the best way to extract info from a XML file. Perl is much more responsive, and it is rather simple (XML:: Simple same). Here is a simple example that you can just copy paste it into a (pseudo) terminal:
Code:
cat > /tmp/l.xml <<WTF
<?xml version="1.0" ?>
<!DOCTYPE Foobar>
<Foobar Version="1.0">
<Accounts>
<Account>
<Balance_current>99999999</Balance_current>
</Account>
</Accounts>
</Foobar>
WTF
perl -MXML::Simple -e '$c = XMLin("/tmp/l.xml" ); print $c->{Accounts}->{Account}->{Balance_current}, "\n";'
If you know perl, you just install this module if needed with the command:
Code:
# cpan -i XML::Simple
OR
Code:
perldoc XML::Simple
Bookmarks