~/bin/sp

#25
Raw
Author
winny
Created
Sept. 4, 2020, 3:30 p.m.
Expires
Never
Size
230 bytes
Hits
122
Syntax
Bash
#!/bin/sh
# Simple spell checker. Usage: sp the words to check
set -eu
echo "$@" | aspell -a | awk '
match($0, /^& (.*) [0-9]+ [0-9+]: (.*)/, ary) {
  printf("%s: %s\n", ary[1], ary[2]);
  code=1;
}
END {
  exit(code);
}
'