Skip to content

Instantly share code, notes, and snippets.

View randykarels's full-sized avatar

Randy Karels randykarels

View GitHub Profile
@thcipriani
thcipriani / spell.sh
Created February 23, 2017 17:00
I keep this function sourced from my .bashrc—it is incredibly useful.
spell() {
# /me futilely avoids googling words to find their correct spelling
local candidates oldifs word array_pos
oldifs="$IFS"
IFS=':'
# Parse the apsell format and return a list of ":" separated words
read -a candidates <<< "$(printf "%s\n" "$1" \
| aspell -a \
| awk -F':' '/^&/ {