What does [^<]* do?
The first place to find out stuff like this would be the man pages (You are familiar with 'man sed', right?). However, the short answer is: [...] is used to indicate a collection/set of characters. You might see something like [a-zA-Z] to indicate any letter, or [0-9+-.e] to indicate any number. If you place a ^ as the first character within the [], then that negates the regular expression. So, [^<] tells sed to look for any character that is not an <. And the * tells it to look for 0 or more occurrences.
EDIT: Here's another challenge: How would I search a file (same xml file) for another date field (i.e. <date2>YYYY-MM-DD</date2> ) and store that date in a variable?
I assume, I would use a command like awk. But beyond that, I don't have a clue how to store the varying date in between the date2 tags.
Actually, you can use sed again. There are a couple of ways to do it, but probably the easiest for me would be to use a subexpression (A slightly more advanced sed option)
myVar=`sed -n -e 's+.*<date2>\([^<]*\)</date2>.*+\1+p'`
-n tells sed not to print anything unless a p option is used to explicitely print it.
the leading .* and trailing .* are used to gobble up anything on the line outside of the stuff we want, to make sure we don't get any spurious output
the \( \) are used to capture a subexpression, or to create a sort of buffer that can be used later.
the \1 is used to reference the buffer we created earlier
the trailing p tells sed to print the substition we just created.
So, we are reading in each line. Every time we run into a <date2></date2> pair, we will grab whats between the tags, and display only that. All other output will be ignored.
HTH....
BTW, if you are really serious about playing with *nix, and you have to do it for your job, then it would behoove you to convince your boss to send you to an Advanced Unix class, where they teach you about some of the more useful tools like awk, sed, etc. The basic class is usually all stuff you can get from a half-assed book and/or your friends, but some of the advanced stuff is nice to have from a class, because sometimes you don't know what to look for until you've seen it (chicken/egg problem...) Just my $0.02, tho.