Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jeansymolanza/72498610cde2d6cac625628e48b92de9 to your computer and use it in GitHub Desktop.
Save jeansymolanza/72498610cde2d6cac625628e48b92de9 to your computer and use it in GitHub Desktop.
machine_or_job=$(echo "$machine_or_job" | tr '[:upper:]' '[:lower:]' | xargs)
if [[ ! "$machine_or_job" =~ ^(machine|job)$ ]]; then
echo "Variable does not represent a machine or job"
else
echo "Variable represents a machine or a job"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment