[lug] Random access from the shell

David L. Anselmi anselmi at anselmi.us
Wed Nov 12 23:10:25 MST 2008


Jeffrey Haemer wrote:
> Yesterday, Jeremy and I were talking about how to do random access I/O from
> the shell.

That's pretty cool.  I'm surprised how many things that you wouldn't 
seem to use shell for turn out to be rather elegant when someone 
actually sits down and does them.

So what I'd like to see is a way to parse XML in the shell.  Sure, it's 
easy in perl, Java, and whatever.  But how to parse an XML file and then 
write a script using the interesting bits?

I had a problem like that at work and solved it with perl and a wicked 
regex (only one line was interesting so it wasn't worth learning how to 
parse the XML).  perl was better than shell in that case because I was 
doing enough text manipulation to make shell cumbersome.

But I could easily see wanting to do more complex parsing but less 
complex processing where a shell XML parser would be handy.  Anyone seen 
one?

Dave



More information about the LUG mailing list