My Server machine run Window,and it installed Cygwin.My Client machine run linux.In Clinent machine.I do this:[sikaiwei@login-1-2 v1.4]$ bash test.sh CHUN~19900405 sikaiwei@192.168.9.102:/ifs2/BC_MG/GROUP/sikaiwei/ssh/v1.4startPuTTY Secure Copy clientRelease 0.63Usage: pscp [options] [user@]host:source target   pscp [options] source [source...] [user@]host:target   pscp [options] -ls [user@]host:filespecOptions: -V        print version information and exit -pgpfp    print PGP key fingerprints and exit -p        preserve file attributes -q        quiet, don't show statistics -r        copy directories recursively -v        show verbose messages -load sessname  Load settings from saved session -P port   connect to specified port -l user   connect with specified username -pw passw login with specified password -1 -2     force use of particular SSH protocol version -4 -6     force use of IPv4 or IPv6 -C        enable compression -i key    private key file for authentication -noagent  disable use of Pageant -agent    enable use of Pageant -batch    disable all interactive prompts -unsafe   allow server-side wildcards (DANGEROUS) -sftp     force use of SFTP protocol -scp      force use of SCP protocolendIt seems warn me that I use 'pscp' in my test.sh file worngly! But I don't.And my test.sh is:#!/bin/bashsshpass -p 'CHUN~19900405' ssh sikaiwei@172.16.22.53 'echo start;touch final_result.txt;pscp -pw $1  final_result.txt $2;echo end;';But when I use .. instead of '..',like#!/bin/bashsshpass -p 'CHUN~19900405' ssh sikaiwei@172.16.22.53 echo start;touch final_result.txt;pscp -pw $1  final_result.txt $2;echo end;;It don't repost error :[sikaiwei@login-1-2 v1.4]$ bash test.sh CHUN~19900405 sikaiwei@192.168.9.102:/ifs2/BC_MG/GROUP/sikaiwei/ssh/v1.4startendI must use '..' instead of .. to use enviorment variable of Server machine.like[sikaiwei@login-1-2 v1.4]$ sshpass -p 'CHUN~19900405' ssh 172.16.22.53 -l sikaiwei   getId=$ORANGE;echo $ORANGE;ORANGE=$((ORANGE+1));echo $ORANGE;echo 'getId is '+$getId;The $ORANGE is variable of Server machine.So I must use '..',and how to still use $1,$2 to get arguements ?
the difference between '..' and .. when I use ssh usr@ip 'pscp ......'
shell;ssh;quoting;remote;pscp
Variables are not expanded in single quotes, which is how you are passing the commands in the first instance. As such, in the first case, the shell on the remote end never receives your values, it just receives literal $1 and $2,  and they do not exist, so they expand to nothing.$ var=foo$ echo '$var'$var$ echo $varfoopscp therefore gets no values when you pass $1 and $2 (because they do not exist on the remote shell), so it errors out at startup. This is how pscp ends up getting invoked:pscp -pw final_result.txtUse double quotes when you want variables to be expanded by the current shell, not single quotes. Using single quotes in this case would only be appropriate if you wanted the variables to expanded by the remote shell.