我安装了Cygwin来编译和运行C程序。我正在尝试使用 Notepad++ 作为编辑器来编写自己的 shell 程序。当我从命令行(使用 nppexec)执行编译的 .exe 文件时,它在 Cygwin 环境之外运行。
以下重定向命令不会与 Window 的 cmd 一起运行:
$ sort -r < test3.txt
-rThe system cannot find the file specified.
但是当程序通过 Cygwin 的 Mintty 执行时有效:
$ sort -r < test3.txt
test3.txt
test.txt
sh.exe
sh.c
1.txt
我使用以下代码与 nppexec 一起运行来启动程序:
cd $(CURRENT_DIRECTORY)
gcc "$(FILE_NAME)" -o $(NAME_PART).exe
cmd.exe /c start cmd /k $(NAME_PART).exe
如何编辑以上内容以在 Cygwin 环境中启动?
我尝试过但没有运气:
cmd /c start mintty ./$(NAME_PART).exe
最佳答案
Windows 命令行有它自己的 sort
命令,其行为与通过 Cygwin 命令行提供的变体不同。
关于c - 通过命令行在Cygwin环境中启动C程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32515343/