Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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? –  billc.cn Oct 19 '12 at 22:58
    
It's actually cat from MSYS. oldwiki.mingw.org/index.php/MSYS I get the same behavior piping into other programs as well. –  jncraton Oct 20 '12 at 18:32

1 Answer 1

Try this:

echo. | jshint test.js | cat

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

share|improve this answer

Your Answer

 
discard

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.