Would you mind showing us
exactly what you're doing, rather than just vaguely describing it? Give us some detailed examples of how you're setting the variables, and how you are trying to use them later, along with the actual and expected output.
The details can be very important in matters such as this.
As one suggestion though, quotes can be combined. You can double-quote the part of the string that holds the variable, and single-quote the rest.
http://mywiki.wooledge.org/Quotes
Also, using the full expansion syntax can be used to separate variables embedded inside strings. Example:
Code:
$ line="foobar"
$ echo "thisisa$lineline"
thisisa
$ echo "thisisa${line}line"
thisisafoobarline
Oh, and please use
[code][/code] tags around your code, to preserve formatting and to improve readability.