Created
January 19, 2020 09:16
-
-
Save abel0b/75ab517c2ab571050f6f17fde9bf25bf to your computer and use it in GitHub Desktop.
Create human-readable url slug in bash
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
function slug() { | |
echo "$1" | sed "s/\s/-/g" | tr "[:upper:]" "[:lower:]" | |
} | |
slug "Hello World!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment