When I get it right, $LOGDATA is defined for you when you ssh
to the remote machine. I.e. itís a variable only known on the remote side, but not when you include it in the local scp
command. So it must be executed on the remote side instead:
$ ssh -C server cat \$LOGDATA/temp.txt | cat > temp.txt
I added -C
to compress the file during the transfer.