Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shell 被空格替换的变量_Shell_Cygwin - Fatal编程技术网

Shell 被空格替换的变量

Shell 被空格替换的变量,shell,cygwin,Shell,Cygwin,我在cygwin终端上使用shell脚本复制文件中的几行 mkdir CPM_WORKAREA touch ~/.ssh/config echo "Host gerrit.epk.ericsson.se" >> ~/.ssh/config echo "HostkeyAlgorithms ssh-dss" >> ~/.ssh/config echo "Hostname 136.225.198.208" >> ~/.ssh/config echo User $si

我在cygwin终端上使用shell脚本复制文件中的几行

mkdir CPM_WORKAREA
touch ~/.ssh/config
echo "Host gerrit.epk.ericsson.se" >> ~/.ssh/config
echo "HostkeyAlgorithms ssh-dss" >> ~/.ssh/config
echo "Hostname 136.225.198.208" >> ~/.ssh/config
echo User $signumid >> ~/.ssh/config
echo "PubKeyAuthentication yes" >> ~/.ssh/config
echo "IdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config
在上述文件中,$signumid是一个变量,我试图通过命令行使用以下命令设置其值:

    sh script1.sh signumid="john"

但是,当运行上述脚本时,它会复制配置文件中的行,但在signumid之前留下空白,否则字符串signumid=john将被理解为脚本的参数

signumid="john" sh script1.sh

sh script1.sh signum=“john”和signum=“john”sh script.sh之间有什么区别