S
Skye Shaw!@#$
C:\>badcmd
'badcmd' is not recognized as an internal or external command,
operable program or batch file.
C:\>echo %errorlevel%
9009
C:\>ruby -ve"%x|badcmd 2>&1|; p $?.exitstatus"
ruby 1.9.3p429 (2013-05-15) [i386-mingw32]
1
C:\>ruby -ve"%x|ruby -e'exit 1'|; p $?.exitstatus"
ruby 1.9.3p429 (2013-05-15) [i386-mingw32]
1
When using backticks on Windows how does one differentiate between a process exit status of 1 and a command not being found? (Note that Errno::ENOENT is not raised when output is redirected).
This is not a problem in *nix boxes.
'badcmd' is not recognized as an internal or external command,
operable program or batch file.
C:\>echo %errorlevel%
9009
C:\>ruby -ve"%x|badcmd 2>&1|; p $?.exitstatus"
ruby 1.9.3p429 (2013-05-15) [i386-mingw32]
1
C:\>ruby -ve"%x|ruby -e'exit 1'|; p $?.exitstatus"
ruby 1.9.3p429 (2013-05-15) [i386-mingw32]
1
When using backticks on Windows how does one differentiate between a process exit status of 1 and a command not being found? (Note that Errno::ENOENT is not raised when output is redirected).
This is not a problem in *nix boxes.