From owner-freebsd-questions@FreeBSD.ORG Fri May 12 15:56:22 2006 Return-Path: X-Original-To: freebsd-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 46A6916A458 for ; Fri, 12 May 2006 15:56:22 +0000 (UTC) (envelope-from nospam@mgedv.net) Received: from mgedv.at (mail.mgedv.at [195.3.87.103]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C67943D4C for ; Fri, 12 May 2006 15:56:19 +0000 (GMT) (envelope-from nospam@mgedv.net) Received: from metis (localhost [127.0.0.1]) by mgedv.at (SMTPServer) with ESMTP id 409AD186864; Fri, 12 May 2006 17:55:56 +0200 (MEST) From: "No@SPAM@mgEDV.net" To: "'Giorgos Keramidas'" Date: Fri, 12 May 2006 17:56:16 +0200 Message-ID: <000d01c675dc$9a36dee0$01010101@avalon.lan> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <4464A94C.6020606@mac.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Thread-index: AcZ12Xuu304OSnp8SBGVO69FlkGpKQAAnlwg Cc: freebsd-questions@freebsd.org Subject: RE: Trimming Whitespace From Beginning and end of Text Lines X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: nospam@mgedv.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 May 2006 15:56:22 -0000 > > sed -i -e 's/^[[:space:]]*' -e 's/[[:space:]]*$//' file ... why not use just (you can change the "-" separator to "/" as above): sed -e 's-^ *--g' -e 's- *$--g' usage examples: -> cat file| sed ... >file1 -> echo $variable| sed ... |grep xy -> if [ "`echo $xy|sed ...`" = "blabla bla" ]; then ... cu...