Created
January 21, 2012 02:52
-
-
Save karronoli/1650964 to your computer and use it in GitHub Desktop.
command prompt test. escap & redirect to stdin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@rem call cmd.exe /v:on /c "cmd.exe /c c.bat & echo HOGE_!ERRORLEVEL!" | |
@rem return HOGE_255(stdout) | |
find /V "THIS_STRING_IS_NO_USE_IN_BAT" <%~0 >redirect.bat & cmd.exe /v:on /c "redirect.bat >%~n0.log 2>&1" & set REDIRECT=!ERRORLEVEL! & del redirect.bat & exit /b !REDIRECT! | |
set TEST_ENV=1 | |
echo hoge | |
echo redirect %TEST_ENV% 1>&3 | |
if () UNEXPECTED_EXIT | |
sleep 1 | |
exit /b 3 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment