I actually worked on such a script a little over a month ago but haven't
had a chance to get back to it. I've reviewed your script and have
inlined some comments/suggestions below.
Thanks a lot :)
Most of your suggestions are pretty straightforward and I'll put them in, but the PV name problem is nasty, sorting out my script to deal with them is doable, but there is an issue with setting lvm.conf to filter devices called /dev/$*^ would really upset the regular expression parser. I'm tempted to say that people who call their devices things like that deserve everything they get,