[ ! -x $fastboot ] && ! chmod -x $fastboot Should add execute permission, not remove chmod +x $fastboot