Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/28.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
Windows 如何在cygwin中执行shell脚本?_Windows_Shell_Cygwin - Fatal编程技术网

Windows 如何在cygwin中执行shell脚本?

Windows 如何在cygwin中执行shell脚本?,windows,shell,cygwin,Windows,Shell,Cygwin,name.sh已保存在C:\Documents and Settings\user中,我键入sh name.sh sh:testing.sh:没有这样的文件或目录 任何帮助都将不胜感激 只需键入/name.sh,脚本就会运行 如果当前目录不在$PATH中,则添加/会告诉shell查看那里 另一种可能是您当前未在正确的目录中。如果pwd的结果显示您不在C:\Documents and Settings\user,则您需要cd到该目录,或将脚本移动到您所在的任何目录。在名称前面添加//name.sh

name.sh已保存在C:\Documents and Settings\user中,我键入sh name.sh

sh:testing.sh:没有这样的文件或目录


任何帮助都将不胜感激

只需键入
/name.sh
,脚本就会运行

如果当前目录不在
$PATH
中,则添加
/
会告诉shell查看那里


另一种可能是您当前未在正确的目录中。如果
pwd
的结果显示您不在
C:\Documents and Settings\user
,则您需要
cd
到该目录,或将脚本移动到您所在的任何目录。

在名称前面添加//name.sh

请不要。