Last active
December 16, 2015 22:19
-
-
Save airtonix/5506188 to your computer and use it in GitHub Desktop.
slugify for dash (the bash like interpreter on Ubuntu)
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
#!/bin/sh | |
# | |
# Installation | |
# mkdir ~/bin | |
# cd ~/bin | |
# wget http://gist.github.com/raw//5506188/slugify | |
# chmod +x ~/bin/slugify | |
# | |
# Usage | |
# $ lspci > ~/Desktop/pci-devices-$(slugify `date`).report | |
# ~/Desktop/pci-devices-fri-may-3-08-45-01-cst-2013.report | |
# | |
# $ slugify this That and Another | |
# this-that-and-another | |
echo $@ | sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment