Finding Duplicate Lines with Regex
Monday, January 21st, 2008If you are looking to remove duplicate lines from an alphabetized list this code will do the trick:
Find the duplicate lines
^(.*)(\r?\n\1)+$
Replace with a single line
$1
If you are looking to remove duplicate lines from an alphabetized list this code will do the trick:
Find the duplicate lines
^(.*)(\r?\n\1)+$
Replace with a single line
$1
After chatting with my buddy Dave about how awesome it is to show off using terminal to !1337 computer users I realized how often I’m sitting at command-line listening to music in iTunes and wondered how to control iTunes with a shell script.
I searched around an found this article on the topic but of course wanted many tweaks of my own so I’ve wrote the following script that should allow anyone to control iTunes in terminal or via SSH remotely.
The implications are pretty neat if you think about it.