Created
December 19, 2014 22:58
-
-
Save tom-galvin/ef037bc4540cc8294071 to your computer and use it in GitHub Desktop.
DailyProgrammer Challenge #193e2
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
#!/bin/bash | |
declare -A SUBS=( | |
['lol']='laugh out loud' \ | |
['dw']='don'\''worry' \ | |
['hf']='have fun' \ | |
['gg']='good game' \ | |
['brb']='be right back' \ | |
['g2g']='got to go' \ | |
['wtf']='what the fuck' \ | |
['wp']='well played' \ | |
['gl']='good luck' \ | |
['imo']='in my opinion') | |
read INPUT | |
eval "echo "$INPUT" | sed -r $(for ACR in "${!SUBS[@]}"; do printf " -e \"s/\\\\b$ACR\\\\b/${SUBS[$ACR]}/g\""; done)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment