Q: What is the difference between these two shell statements?
$cmd >> $logFile 2>&1
$cmd 2>&1 >> $logFile
The first one is right and second one is wrong.
first one redirects any output from the $cmd to the $logFile. The second one just redirects the output and not the STDERR to the $logFile.