Have you tried:
Code: Select all
REMOTE="\"/tmp/remote file.jpg\""Code: Select all
REMOTE="\"/tmp/remote file.jpg\""Tilde expansion is inhibited by double quotes. You can write LOCAL=~/"Desktop/local file.jpg", or LOCAL="$HOME/Desktop/local file.jpg".ednl wrote:LOCAL="~/Desktop/local file.jpg"
Both variables have embedded spaces. You need them to be passed to scp as two arguments, and not four. This can only be achieved by putting the expansions inside double quotes, not by inserting quotes or backslashes into the variables' contents. Using quotes protects the arguments from the local shell, so only the remote argument needs extra protection:scp host:$QQREMOTE $QLOCAL
Code: Select all
scp host:"$QREMOTE" "$LOCAL"