From owner-freebsd-questions@FreeBSD.ORG Thu Dec 22 19:46:27 2005 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 A109D16A41F for ; Thu, 22 Dec 2005 19:46:27 +0000 (GMT) (envelope-from tijl@ulyssis.org) Received: from nibbel.kulnet.kuleuven.ac.be (nibbel.kulnet.kuleuven.ac.be [134.58.240.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17E8A43D53 for ; Thu, 22 Dec 2005 19:46:26 +0000 (GMT) (envelope-from tijl@ulyssis.org) Received: from localhost (localhost [127.0.0.1]) by nibbel.kulnet.kuleuven.ac.be (Postfix) with ESMTP id 7C6184C602; Thu, 22 Dec 2005 20:46:25 +0100 (CET) Received: from smtp02.kuleuven.be (lepidus.kulnet.kuleuven.ac.be [134.58.240.72]) by nibbel.kulnet.kuleuven.ac.be (Postfix) with ESMTP id EE2624C111; Thu, 22 Dec 2005 20:46:24 +0100 (CET) Received: from kalimero.kotnet.org (kalimero.kotnet.org [10.4.42.180]) by smtp02.kuleuven.be (Postfix) with ESMTP id 855D22CAAB0; Thu, 22 Dec 2005 20:46:24 +0100 (CET) Received: from kalimero.kotnet.org (kalimero.kotnet.org [127.0.0.1]) by kalimero.kotnet.org (8.13.4/8.13.4) with ESMTP id jBMJkMTs003225; Thu, 22 Dec 2005 20:46:22 +0100 (CET) (envelope-from tijl@ulyssis.org) From: Tijl Coosemans To: freebsd-questions@freebsd.org Date: Thu, 22 Dec 2005 20:46:21 +0100 User-Agent: KMail/1.8.3 References: <200512211704.49530.mi+mx@aldan.algebra.com> <20051222183250.GB39217@dan.emsphone.com> <200512221414.10321.mi+mx@aldan.algebra.com> In-Reply-To: <200512221414.10321.mi+mx@aldan.algebra.com> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-u" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200512222046.22133.tijl@ulyssis.org> X-Virus-Scanned: by KULeuven Antivirus Cluster Cc: Mikhail Teterin Subject: Re: what's an equivalent for the following Perl one-liner? 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: Thu, 22 Dec 2005 19:46:27 -0000 On Thursday 22 December 2005 20:14, Mikhail Teterin wrote: > =DE=C5=D4=D7=C5=D2 22 =C7=D2=D5=C4=C5=CE=D8 2005 13:32, Dan Nelson =F7=C9= =CE=C1=D0=C9=D3=C1=CC=C9: > > In the last episode (Dec 21), Mikhail Teterin said: > > > I'd like a sed string, that will remove both the carriage returns > > > and the blanks at eol in one go. Perl appears to recognize the \r > > > character and DTRT: > > > > > > perl -p -e 's,[ \r]+$,,' < in > out > > > > > > What's the sed's equivalent? Thanks! > > > > sed -E 's,[ ^M]*$,,' < in > out > > > > Note the ^M is a single control-character (entered via Ctrl-V > > Ctrl-M at a shell prompt for example). > > Yes, I used this in the past, but the ports' Makefiles are supposed > to be ASCII-only :-( Try col(1) or tr(1) to remove the carriage return and then sed to remove=20 the spaces.