I'd like to send a remote command via ssh session. The command body has some variables to eval in local host. here's my command :
EEEE="fefe"; ssh <name>@<server> 'echo ${EEEE}'
The variable EEEE
cannot be recognised since it try to evaluate it from the remote session (and not from the local where i've defined it)
this example, however, will work perfectly and produce the 'fefe' output :
ssh <name>@<server> 'EEEE="fefe"; echo ${EEEE}'
another solution is by using temporal string on local host to evaluate the variable locally, and then, send the result for execution in remote server.
EEEE="fefe"
COMM="echo ${EEEE}"
ssh <name>@<server> 'echo $COMM'
This there another option to force local variable evaluation ?