Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cwjcc!hal!ncoast!allbery From: badri@ur-valhalla.UUCP (Badri Lokanathan) Newsgroups: comp.sources.misc Subject: v04i112: SUPERSEDES v04i111: A convenient spelling filter based on 'spell' (revised) Keywords: spell,vi Message-ID: <1509@valhalla.ee.rochester.edu> Date: 4 Oct 88 01:13:07 GMT Sender: allbery@ncoast.UUCP Reply-To: badri@ur-valhalla.UUCP (Badri Lokanathan) Organization: UR Dept. of Electrical Engg, Rochester NY 14627 Lines: 59 Approved: allbery@ncoast.UUCP Supersedes: <1505@valhalla.ee.rochester.edu> Posting-number: Volume 4, Issue 112 Submitted-by: "Badri Lokanathan" Archive-name: spell_check.sh (To the moderator: I posted an earlier version which was incomplete and buggy; I am not even sure if it reached you. Please cancel it.) [Superseded; let's see if this works as claimed. ++bsa] The following shell script, based on spell, is convenient for highlighting spelling errors, either in a vi session or stand alone. I wrote it so that I could pipe text from within a vi session through it. (Note that you cannot just say !}spell in vi since it would destroy your text!) [It may anyway. Many "vi"'s have a bug when large amounts of text are piped to/from a command. You have been warned! ++bsa] ------------%< cut here and save in spell_check ---------------------------- #!/bin/sh ############################################################################ # A sh script to allow spelling checks either in vi or stand alone # # Usage: spell_check < file or within vi, # # !}spell_check or # # :(addressed lines)!spell_check # # # # Wrongly spelled words will be surrounded as ###bad-word### # # WARNING: Do not try and sell this tiny shell script to some # # poor sucker! # # Badri Lokanathan, 30 September 1988 # ############################################################################ doc=/tmp/splchk.$$ scr=/tmp/sedscr.$$ trap 'rm -f $doc $scr; exit 1' 1 2 15 cat > $doc cat > $scr <> $scr cat >> $scr <