Get exit code from subshell through the pipes

By using $() you are (effectively) creating a subshell. Thus the PIPESTATUS instance you need to look at is only available inside your subshell (i.e. inside the $()), since environment variables do not propagate from child to parent processes. You could do something like this: OUT=$( wget -q “http://budueba.com/net” | tee -a “file.txt”; exit ${PIPESTATUS[0]} … Read more

What does Error-code 0xc0000135 (or -1073741515 Exit-code) mean when starting a Windows app?

From the ntstatus.h SDK header file: // // MessageId: STATUS_DLL_NOT_FOUND // // MessageText: // // The program can’t start because %hs is missing from your computer. // Try reinstalling the program to fix this problem. // #define STATUS_DLL_NOT_FOUND ((NTSTATUS)0xC0000135L) // winnt The “try reinstalling the program” advice is solid, it is however up to you … Read more