An alternative approach would be:
if ! command -v scp >/dev/null 2>&1; then echo "scp could not be found." exit 1 fi