rc=$? if [[ ${rc} -ne 0 ]]; then echo "cp -i $file1 $file2 failed with a value of ${rc}" fi