-
-
Save diraol/26be250e220b1315cf652017c35b0c0c to your computer and use it in GitHub Desktop.
Quick bash slugify
This file contains 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
# POSIX Compatible | |
# Remove leading and trailing spaces and dashes | |
# also zsh compatible | |
echo " - - Esperança do vôo do avião - - " | iconv -t ascii//TRANSLIT | sed -E 's/[~\^]+//g' | sed -E 's/[^a-zA-Z0-9]+/-/g' | sed -E 's/^-+\|-+$//g' | sed -E 's/^-+//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