Finds English Language spelling errors.
spell [ -b ] [ -i ] [ -l ] [ -v ] [ -x ] [ -d HashList ] [ -h HistoryList ] [ -s HashStop ] [ + WordList ] [ File ... ]
The spell command reads words in the file indicated by the File variable and compares them to those in a spelling list. Words that cannot be matched in the spelling list or derived from words in the spelling list (by applying certain inflections, prefixes, and suffixes) are written to standard output. If no file name is specified, the spell command reads standard input.
The spell command ignores the same troff, tbl, and eqn codes as does the deroff command.
The coverage of the spelling list is uneven. You should create your own dictionary of special words used in your files. Your dictionary is a file containing a sorted list of words, one per line. To create your dictionary, use the spellin command.
Files containing an alternate spelling list, history list, and stop list can be specified by file name parameters following the -d, -f, and -h flags. Copies of all output can be accumulated in the history file.
Three programs help maintain and check the hash lists used by the spell command:
The File parameter specifies the files that the spell command reads and compares them with the spelling list. If no file is specified, the command reads standard input.
-b | Checks British spelling. However, this flag does not provide a reasonable prototype for British spelling. The algorithms to derive a match against the spelling dictionary by applying certain inflections, prefixes, and suffixes are based on American English spelling. |
-i | Suppresses processing of include files. |
-l | Follows the chain of all include files (.so and .nx formatting commands). Without this flag, the spell command follows chains of all include files except for those beginning with /usr/lib. |
-v | Displays all words not in the spelling list and indicates possible derivations from the words. |
-x | Displays every possible word stem with an = (equal sign). |
-dHashList | Specifies the HashList file as the alternative spelling list. The default is /usr/share/dict/hlist[ab]. |
-hHistoryList | Specifies the HistoryList file as the alternative history list, which is used to accumulate all output. The default is /usr/lbin/spell/spellhist.
Note: The HistoryList file must be an existing file with read and write permissions. |
-sHashStop | Specifies the HashStop file as the alternative stop list, which is used to filter out misspellings that would otherwise pass. The default is /usr/share/dict/hstop. |
+WordList | Checks WordList for additional word spellings. WordList is the name of a file you provide that contains a sorted list of words, one per line. With this flag, you can specify a set of correctly spelled words (in addition to the spell command's own spelling list) for each job. |
The following exit values are returned:
0 | Indicates successful completion. |
>0 | Indicates an error occurred. |
spell chap1 >mistakesThis creates a file named mistakes containing all the words found in chap1 that are not in the system spelling dictionary. Some of these may be correctly spelled words that the spell command does not recognize. Save the output of the spell command in a file because the word list may be long.
spell -b chap1 >mistakesThis checks chap1 against the British dictionary and writes the questionable words in the mistakes file.
spell -v chap1 >derivThis lists words not found literally in the dictionary but are derived from forms of dictionary words. The prefixes and suffixes used to form the derivations are indicated for each word. Words that are not in the dictionary at all are also listed.
spell +newwords chap1This checks the spelling of words in chap1 against the system dictionary and against newwords . The newwords file lists words in alphabetical order, one per line. You can create this file with a text editor, such as the ed editor, and alphabetize it with the sort command.
The deroff command, eqn command, neqn command, sed command, sort command, spellin command, spellout command, tbl command, tee command, troff command.