To split a line into a space (in general, into $IFS), like into other shells:$=sshcmd
But instead, you should make an sshcmdarray so that your commands still work if one of the options contains spaces:
sshcmd=(ssh -someopts myopts)
$sshcmd[@] "echo hello world"
This applies to bash and ksh, by the way, by the way; but there you should also protect the replacement of the array variable from further splitting and expanding the file name:
sshcmd=(ssh -someopts myopts)
"${sshcmd[@]}" "echo hello world"
source
share