0
votes

I installed Cygwin to compile and run C programs. I'm trying to write my own shell program using Notepad++ as my editor. When I execute the compiled .exe file from the command line (using nppexec) it runs outside the Cygwin environment.
The following redirect command won't run with Window's cmd:

$ sort -r < test3.txt
-rThe system cannot find the file specified.

But works when the program is executed through Cygwin's Mintty:

$ sort -r < test3.txt
test3.txt
test.txt
sh.exe
sh.c
1.txt

I'm using the following code to run with nppexec to launch the program:

cd $(CURRENT_DIRECTORY)

gcc "$(FILE_NAME)" -o $(NAME_PART).exe

cmd.exe /c start cmd /k $(NAME_PART).exe

How do I edit the above to launch in the Cygwin Environment?
I've tried with no luck:

cmd /c start mintty ./$(NAME_PART).exe
1

1 Answers

0
votes

The Windows command line have it's own sort command, that behaves differently than the variant available through the Cygwin command line.