From owner-freebsd-questions@FreeBSD.ORG Fri Aug 25 17:31:57 2006 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B0B816A4DA for ; Fri, 25 Aug 2006 17:31:57 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id A38BB43D45 for ; Fri, 25 Aug 2006 17:31:56 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.pc (host5.bedc.ondsl.gr [62.103.39.229]) (authenticated bits=128) by igloo.linux.gr (8.13.7/8.13.7/Debian-2) with ESMTP id k7PHVULK007442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 Aug 2006 20:31:39 +0300 Received: from gothmog.pc (gothmog [127.0.0.1]) by gothmog.pc (8.13.7/8.13.7) with ESMTP id k7PHVefL079991; Fri, 25 Aug 2006 20:31:40 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.pc (8.13.7/8.13.7/Submit) id k7PHVZtK079990; Fri, 25 Aug 2006 20:31:35 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Fri, 25 Aug 2006 20:31:35 +0300 From: Giorgos Keramidas To: Kyrre Nyg?rd Message-ID: <20060825173135.GE78862@gothmog.pc> References: <7.0.1.0.2.20060824145822.0194fc10@broadpark.no> <1b15366e0608240618j62d41ad3j537f095b2e566ed5@mail.gmail.com> <7.0.1.0.2.20060824192439.02386de8@broadpark.no> <1b15366e0608241209t1d655b5fl98063ecb6221b0a8@mail.gmail.com> <7.0.1.0.2.20060825152152.02385da8@broadpark.no> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7.0.1.0.2.20060825152152.02385da8@broadpark.no> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (score=-2.854, required 5, autolearn=not spam, AWL -0.26, BAYES_00 -2.60, UNPARSEABLE_RELAY 0.00) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: questions@freebsd.org, "Matti J. Karki" Subject: Re: Code beautifiers, anyone? 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: Fri, 25 Aug 2006 17:31:57 -0000 On 2006-08-25 15:24, Kyrre Nyg?rd wrote: > At 21:09 24.08.2006, Matti J. Karki wrote: > > >Well, my scripts aren't magic. They are pretty simple. Here's few (not > >scripts, these are valid Vim regexps): > > Those are great regexps, Matti, thank you so much. > > They have been noteworthy recorded! > > Say, could I use these with Sed let's say in a Bash script? > > One more question about :%s/^ *$//g versus :%s/ *$//g, > won't the latter here perform the job of the former? They are different for a reason, I guess: The first one matches lines that only have spaces (it fails spectacularly with lines that have a mix of TAB vs. SPACE characters though, unless you pre-expand TABs). The second one only removes trailing SPACEs from a line.