First, it's not really safe to store unencrypted passwords, which is why
most unix systems don't do it. What you are trying to do is definatly
possible (you'll find just about everything is with unix), but it would
take a fair amount of scripting. Why do you need such a script? I'd
suggest hiring a unix administrator before you wreck something, if this
is at all important.