Skip to content

Instantly share code, notes, and snippets.

@wlonkly
Created September 1, 2023 00:00
Show Gist options
  • Save wlonkly/348910a0a40fc63dcca2250c758b0a34 to your computer and use it in GitHub Desktop.
Save wlonkly/348910a0a40fc63dcca2250c758b0a34 to your computer and use it in GitHub Desktop.
a8e () { LEN=$(( $(echo -n $1 | wc -c) - 2)); echo $1 | sed "s/^\(.\).*\(.\)$/\1$LEN\2/"; }
e9e () { LEN=$(echo $1 | sed 's/^.\(.*\).$/\1/'); GREP=$(echo $1 | sed "s/^\(.\).*\(.\)$/^\1.{$LEN}\2$/"); grep -E "$GREP" /usr/share/dict/words; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment