I am trying to test the exit status of the cleartool lsvtree statement below, but it doesn't seem to be working due to the tail pipe, which it is testing instead. Is there a way around this without adding a tonne of new code?
cleartool lsvtree $testlocation/$exe_name | tail -15
#exit out if not file not in dir
if [ $? -ne 0 ]; then
echo "Error: File not in test or application area"