我正在运行具有基本命令的Shell脚本。
对于脚本中的任何命令,我收到如下错误:
第 3548 行: MV:未找到命令 第 3550 行: cmd: 找不到命令 第 708 行: MKDIR: 找不到命令 第 715 行: Cygpath: 找不到命令 第 726 行: MV: 找不到命令 第 727 行: CP: 找不到命令 第 731 行: MV: 找不到命令 第 732 行: CP: 找不到命令 第
736 行: MV: 找不到命令
第 737 行: CP:找不到
命令 第 749 行:expr:找不到命令 第 770 行:expr:找不到
命令
注意:我已经在我的Windows系统变量PATH中添加了c:\cygwin\bin和c:\Cygwin\usr下的各种其他目录,如sbin,X11R6,local。我还尝试重新安装具有相同问题的Cygwin。我正在使用 Windows 10。我在管理模式下运行cmd,然后运行bash。
bash的第一个调用必须是登录shell。 如果不是,环境设置不当
E:cygwin64>binbash.exe
bash: arch: command not found
bash: ARCH: command not found
bash: ARCH: command not found
bash: dircolors: command not found
marco@FG /
虽然环境正确使用登录外壳
E:cygwin64>binbash.exe -l
marco@FG ~
这就是Mintty/Cygwin终端快捷方式使用"-"的原因
$ mintty --help
Usage: mintty [OPTION]... [ PROGRAM [ARG]... | - ]
Start a new terminal session running the specified program or the user's shell.
If a dash is given instead of a program, invoke the shell as a login shell.
...