From owner-freebsd-questions@FreeBSD.ORG Tue Aug 26 04:00:16 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 173FD1065673 for ; Tue, 26 Aug 2008 04:00:16 +0000 (UTC) (envelope-from kline@thought.org) Received: from aristotle.thought.org (ns1.thought.org [209.180.213.210]) by mx1.freebsd.org (Postfix) with ESMTP id A6B3C8FC1E for ; Tue, 26 Aug 2008 04:00:15 +0000 (UTC) (envelope-from kline@thought.org) Received: from ethos.thought.org (ethos.thought.org [10.47.0.180]) (authenticated bits=0) by aristotle.thought.org (8.14.2/8.14.2) with ESMTP id m7Q40M9I093155 for ; Mon, 25 Aug 2008 21:00:22 -0700 (PDT) (envelope-from kline@thought.org) From: Gary Kline To: FreeBSD Mailing List Content-Type: text/plain Date: Mon, 25 Aug 2008 21:00:10 -0700 Message-Id: <1219723211.4994.165.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=3.6 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on aristotle.thought.org Subject: script to assist ASCII text X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Aug 2008 04:00:16 -0000 People, This had eluded me for years and it may not be possible, but here goes. I write using vi or, less frequently vim. Is there any sh script that would make sure that there were exactly one space ('\040') between words, and three spaces between sentences? My definition of "a sentence" is a string of words that ends in a period or question-mark, exclamation-mark, or ellipse ("... . || ... ? || ... !) Also, any dash "--" could not have any whitespace around it. Anything except these would print an error. thanks for idea or input, gary