-
-
Save beryllium/f500f7548ae9843c823af8005eed2201 to your computer and use it in GitHub Desktop.
Quick bash slugify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Updated to work on OS X (convert both "-E" flags to "-r" to run on real server OSes) | |
echo "$STRING" | iconv -t ascii//TRANSLIT | sed -E s/[^a-zA-Z0-9]+/-/g | sed -E s/^-+\|-+$//g | tr A-Z a-z |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment