Typing this command on regular cmd.exe or cygwin termal gives me results as expected:
$ ack hello
(I have ack.bat that execute ack.pl in my PATH)
However, when I run the same command from either shell or eshell in Emacs, it gives me this error:
c:\Users\Martin>"C:\cygwin\bin\perl" /cygdrive/c/Users/Martin/Desktop/ack.pl hello
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LANG = "ENU"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
I tried to fix it by SETENV both variable to en_US.UTF-8 but when I run it again, it gave me no result but froze.
Update: I have finally found the solution to this problem. All I need was to add < NUL
to the end of the command since it parse Linux style NULL DEVICE as default.
Now if I type in this:
ack hello < NUL
It'll give me results as expected.