Created
January 8, 2014 20:47
-
-
Save coderofsalvation/8324330 to your computer and use it in GitHub Desktop.
prints out the duplicate parts of 2 strings (bash function)
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
# prints out the duplicate parts of 2 strings | |
# @param string input1 | |
# @param string input2 | |
function stroverlap() | |
{ | |
[ -z "$1" ] && return 1 | |
[ -z "$2" ] && return 1 | |
printf "%s\\n" $@ | awk 'x[$0]++' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment