This is just a work-around (and somewhat of a kluge, at that), but hey, if it works, it gets the job done, and that's what we want, right? (That's what Perl is for!)
Given that the shell script works, use perl to write a working, executable shell script, then execute the shell script in backticks.
Comment on Re: Problem using Backtick having quotes