Skip to content

Instantly share code, notes, and snippets.

@coderofsalvation
Last active September 24, 2019 14:30
Show Gist options
  • Save coderofsalvation/8270476 to your computer and use it in GitHub Desktop.
Save coderofsalvation/8270476 to your computer and use it in GitHub Desktop.
remove non-alphanumeric characters in string
# remove non-alphanumeric characters in string
# @param string
alphanumeric()
{
str="$(cat -)"
echo ${str//[^[:alpha:].-]/}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment