sed will do it, maybe tr.
Both suck, as does all command line backslashing, especially as you move through multipl levels of scripts the need to be re-escaped.

Something along the lines of:
new_var=`echo $old_var | sed 's/ /\ /g`
or along those lines, it's been many years since I do all my scripting in Perl if possible.