Thanks for your quick response Mehul. > >> Can you suggest me the best option to parse an xml from shell ? > >><snip> > > Is this what you want? > > zgrep checksum /path/to/filename.xml.gz
Yeah, I was looking for something similar > > I should have checked before replying. > Some examples in perl and awk are shown here on how to work with xml > files > http://www.issociate.de/board/post/265610/Parse_an_XML_File_using_Shell_script.html > Before that you could use something like > 1. Perl -> http://search.cpan.org/~mikewong/XML-Dumper-0.81/Dumper.pm > 2. Python -> http://docs.python.org/release/2.5.2/lib/module-zlib.html Thanks for these options. Later today I realized that there is also a sqlite db for the yum/zypper repo which resides in the client end. Hence I had taken the below approach. sqlite3 /var/cache/yum/<reponame>/primary.xml.gz.sqlite 'select pkgId from packages where location_href like "%ZSI-1.7-2.el5.mdsc.i386.rpm"' I had also come across xmllint, xmlproc_parse might have also solved my need. _______________________________________________ ILUGC Mailing List: http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
