The above line mutes debug messages, the 0 option does that. I can launch the app from the binary without the script, but debug messages are all over the place (can see them via terminal). How do i do the launching via binary with env and not the script? If i open the script with env DBG=1 i can see debug messages again dropping the mute action, but when i do env DBG=0 directly with the binary - nothing is muted.
2>&1 means “send stderr (the “2”) into the same data stream as stdout (the “1”)”. The next > /dev/null means “send this data stream into /dev/null”.
In layman’s terms, any process in a UNIX system has at a bare minimum three data streams, i.e. input, output, and error messages. So error messages are separated from normal output.
The first construct above takes the error messages that the application produces and routes them into the standard output stream. The second construct above takes the resulting combined data stream and redirects it into the NULL device instead of sending it to the terminal.
Yes, more or less. The end result is the same, but the logic is somewhat different. With &> you are using a shorthand, just like in the difference between the following notations…