updated parser
In my last post I was using if and else to look for each tag, and act on it. Tonight I'm going to convert that ugly mess to a case statement. It's easier to read, and doesn't have the hackish feel of if then, else.
I also learned a new trick that will help in parsing tags if the author mixes case. We'll add a 'shopt -s nocaseglob' to the top of the shell script. This causes wildcard and regexp matches to be case insensitive. It does not, however, change the behaviour of commands like sed and grep. I've already seen a couple feeds there the tags were all upper case, and was worried about having to write some ugly regexp to match the tags.
#!/bin/bash shopt -s nocaseglob