HAS_DEVICE=`adb devices|wc -l|xargs` if [ "$HAS_DEVICE" = "3" ]; then echo "Good, a device has been detected" adb push crontab /sdcard/ else echo "`adb devices` did not show exactly one device, check and try again" fi