Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having a problem with a .cmd script only occasionally passing it's output through a pipe. The script is auto generated by npm and it runs jshint using node. Here's the script:

:: Created by npm, please don't edit manually.
@IF EXIST "%~dp0\node.exe" (
  "%~dp0\node.exe"  "%~dp0\node_modules\jshint\bin\hint" %*
) ELSE (
  node  "%~dp0\node_modules\jshint\bin\hint" %*

Calling this script as jshint test.js always produces the desired output. However, it seems to not always get passed via a pipe. For example, jshint test.js | cat only produces output perhaps 10% of the time. Interestingly, jshint test.js > .jshintjunk & type .jshintjunk | cat works fine, but I'd rather not have the intermediate file.

Any idea how I can resolve this?

share|improve this question
What is cat on Windows?? Cygwin? – Oct 19 '12 at 22:58
It's actually cat from MSYS. I get the same behavior piping into other programs as well. – jncraton Oct 20 '12 at 18:32

Try this:

echo. | jshint test.js | cat

That also happened to me and I solved it passing echo..

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.