Method to get piped command exit status.
Brought to you by:
kwidholm
In function fixPermissions(). I am seeing this code snippet and comment.
diskutil repairPermissions / | tee -a "$LOGFILE"
wait
# TODO: Fix this exit status. This is bogus, since it's actually the result of
# the tee operation rather than the diskutil operation.
loggit "Permissions have been repaired. -$?-"
To overcome this, you could either use "set -o pipefail" or ${PIPESTATUS[0]}
REF: http://tldp.org/LDP/abs/html/internalvariables.html#PIPESTATUSREF
-Logu
Thank you Logu. This has been changed in commit 354455cb46b6672739540ec538bd46f3cb81dec6.