I have been googling about this, but, maybe due to my spanish version of CygWin/Windows, I have not been able to find a solution.
I have latest (December 2014) CygWin 32 bits installed, and it seems there is some problem with its
As you know, CygWin shell can run both Windows and Linux commands, so I am trying to filter the results of my services list command, with this results:
$ sc query state= all | grep "stopped" -i Coincidencia en el fichero binario (entrada estándar)
I think this message translates to:
Binary file match (standard input).
If I try from a Windows shell (using only Windows commands):
C:\Users\Luis-> sc query state= all | find "stopped" /i ESTADO : 1 STOPPED ESTADO : 1 STOPPED ESTADO : 1 STOPPED ESTADO : 1 STOPPED ESTADO : 1 STOPPED
… I obtain the correct results.
This is the CygWin embedded grep version:
$ grep -V grep (GNU grep) 2.21 Copyright (C) 2014 Free Software Foundation, Inc. Licencia GPLv3+: GPL de GNU versión 3 o posterior
I have found some sort of workaround by downloading UnxUtils and using its grep 32bit-Windows version:
$ PathToUNXUtils="/cygdrive/d/Utilidades/UnxUtils/" $ "$PathToUNXUtils"grep -V grep (GNU grep) 2.5.1 Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc. $ sc query state= all | "$PathToUNXUtils"grep "stopped" -i | more.com ESTADO : 1 STOPPED ESTADO : 1 STOPPED ESTADO : 1 STOPPED ESTADO : 1 STOPPED ESTADO : 1 STOPPED ESTADO : 1 STOPPED
But, well… I think the appropriate way to solve this would be to make the original CygWin's grep version work as it must.
What is going on here? Should I download and compile the latest grep version as last hope?