in reply to safe quoting for shell parameters

It sounds to me like you really want to do what a shell does, which is parse the arguments it gets. I'd make use of one or more of the following: