Skip to content

Instantly share code, notes, and snippets.

@abel0b
Created January 19, 2020 09:16
Show Gist options
  • Save abel0b/75ab517c2ab571050f6f17fde9bf25bf to your computer and use it in GitHub Desktop.
Save abel0b/75ab517c2ab571050f6f17fde9bf25bf to your computer and use it in GitHub Desktop.
Create human-readable url slug in bash
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