remsh variables

Hi,

I have script.

#!/bin/sh -x
CD=masterservice
remsh 132.196.133.185 -l root './export $CD > test.output'
rcp root@132.196.133.185:test.output

But I receive the following error.
+ remsh 132.196.133.185 -l root ./export $CD > test.output

To make it work, I remove the ' signs. But then I get problem with the">" .

+ remsh 132.196.133.185 -l root ./export masterservice
+ 1> test.output

If I don�t use the $CD and put masterservice directly in the remsh command,

remsh 132.196.133.185 -l root './export masterservice > test.output'

,I receive no error at all and everything works as it should. But I would like to have the option to use a variable. Anyone who can help me out here?

Try " instead of ' so that variables inside it can be substituted.