Define local variable on remote machine ?

Hello,

I'm executing many commands using ssh and I want to define local vars on remote machine to ease my work:

ssh remote1 <<-heredoc1
cmd1
cmd2
...
heredoc1

This one obviously defines variable on local machine:

ssh remote1 "x=10"

This one returns:

ssh remote1 "'x=10'"
bash: x=10: command not found

How do I define temporary local vars on remote machine using ssh ?

thanks
Vilius

Try this:

ssh remote1 'x=10 y=20; echo x=$x, y=$y'

Note the single quotes to avoid variable expansion on the local system.