Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Using a Terminal-based spell checker Apps
I recently installed the cocoAspell program (it's discussed in this hint). This is one of the best spell checkers around for use with your GUI applications. However, I also wanted to be able to spell check from the command line. cocoAspell can do this, since it's based on the GNU aspell application. The trick is, you have to create links to add the actual binary (which is deeply nested) to your path. Here's how I did it.

Download and install cocoAspell as usual. Now, create a new folder in your home directory called "bin". Next, go to the Terminal and 'cd' into your newly created ~/bin directory. Type the following four commands (the % represents your UNIX shell prompt). Each command is one complete line followed by a single press of the return key:
 % ln -s /Users/username/Library/Services/

% ln -s /Users/username/Library/Services/

% ln -s /Users/username/Library/Services/

% rehash
[Editor's note: The first three commands have been broken onto multiple lines for easier display. Type each as one continuous line, and put a SPACE before the "/Users..." section on the third line. I have not tested this hint myself - read the rest of the hint for more info on actually using the command from the Teminal.]

Now you're ready to spell check! Type cocoAspell check filename at the prompt. Make sure you're in the same directory as the file you're spell checking or else you have to supply the entire path instead of 'filename'.

You can now use cocoAspell in programs such as vi, emacs, lynx, pine etc. Here's a web site that tells you the details on how to access cocoAspell from within these program. It's from the GNU aspell manual, which as I understand, is the basis for cocoAspell. You'll just have to replace cocoAspell with aspell when typing the manual's instructions.


Basically, you are creating aliases to the cocoAspell program and two directories in your ~/bin folder. Your ~/bin folder should automatically be in your UNIX shell path. If, for some reason it is not in the path, you will have to add ~/bin to your path which is beyond the scope of this hint (search macosxhints on "path " for more information).

I know this works for the English dictionary, but I'm not sure if it would work for the others. You might have to add more links. If you get errors saying some directory can't be found, try adding another link to that directory using the above pattern.
  • Currently 1.33 / 5
  You rated: 2 / 5 (3 votes cast)

Using a Terminal-based spell checker | 3 comments | Create New Account
Click here to return to the 'Using a Terminal-based spell checker' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Alternate Link
Authored by: mikego on Oct 22, '02 01:41:01PM

Here's an alternate link to download cocoAspell.

[ Reply to This | # ]
Authored by: bhines on Oct 22, '02 06:03:05PM

Or just "fink install aspell".

Fink also has a whole bunch of aspell dictionaries for other languages.

[ Reply to This | # ]
Using a Terminal-based spell checker
Authored by: r.b on May 19, '03 04:22:33PM

where you able to use this cocoAspell with PHP ?

[ Reply to This | # ]