Created
June 19, 2013 05:15
-
-
Save phx/5811824 to your computer and use it in GitHub Desktop.
uses a few different commands in this specific instance to target a phrase that is repeated again on the same line. i was not going for accuracy, but for speed. there is probably a lot that can be eliminated from this, including the initial `cat` command, which could possibly be replaced by input redirection.
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/bash | |
cat tags.txt | cut -d' ' -f2- | grep -o -v '\ +.+' | tr ' ' '-' | grep -o -E '[a-zA-Z0-9\-]+[a-zA-Z0-9]$' | grep -v '^-' | tr '[A-Z]' '[a-z]' | tr '-' ' ' | sort -u > newtags.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment