perl -i.bak -pe 's/AJZ/AZZ/g if /^AB/' if [[ $? != 0 ]];then exit 1 fi