Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
sed delimiter
#!/bin/bash
# https://www.reddit.com/r/commandline/comments/6nb76h/lpt_use_hashpoundnumbersignoctothorpe_as_a_sed/dk8hanv/
DICT=/usr/share/dict/words
main()
{
SALL=($(egrep '^s(\w).*\1.*\1$' "$DICT"))
for sub in "${SALL[@]}"; do
diff --side-by-side --suppress-common-lines <(sed "$sub" "$DICT") "$DICT" |
while read result bar word; do
grep -q "^$result\$" "$DICT" || continue
echo -e "$ echo $word | sed $sub\n$result"
done
date +%s
done
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.