mkinitrd syntax error regarding conditional expression(s)

So working with an older CentOS 5.1 system today, I ran into a problem which I believed to be mkinitrd related when attempting to install kernel-PAE on a vmguest I upgraded to 4GB of vRAM.

I was seeing this upon yum installing kernel-PAE:

/sbin/mkinitrd: line 489: syntax error in conditional expression: unexpected token `('
/sbin/mkinitrd: line 489: syntax error near `^(d'
/sbin/mkinitrd: line 489: `        if [[ "$device" =~ ^(dm-|mapper/|mpath/) ]]; then'

So it turns out that bash was the problem here not mkinitrd.  I never thought that mkinitrd and bash would be so intertwined, but it makes perfect sense if you think about it.  I just never had to think about it ’til today.

I guess that serves us right for not keeping up with CentOS releases.  A big thanks to SmogMonkey for posting this find on http://www.howtoforge.com/software-raid1-grub-boot-fedora-8-p2#comment-33804.