tar -xvzf $filename.tar.gz || { exit $?; }
Here my scripts would exit with errorCode 141. I am using Fedora Core 6 with tar version 1.15
it wont happen all the time, but more than 70 percent of the time it fails.