Skip to content

Instantly share code, notes, and snippets.

@rabestro
Created March 10, 2023 16:59
Show Gist options
  • Save rabestro/0ebe6167608577c6547336de371d5b78 to your computer and use it in GitHub Desktop.
Save rabestro/0ebe6167608577c6547336de371d5b78 to your computer and use it in GitHub Desktop.
Determine if a word or phrase is an isogram.
#!/usr/bin/env bash
main () {
local -r phrase=${1@L}
local symbols=${phrase//[[:space:]-]/}
for letter in {a..z}
do
symbols="${symbols/$letter/}"
done
[[ -z $symbols ]] && echo 'true' || echo 'false'
}
main "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment