From owner-freebsd-questions@FreeBSD.ORG Mon May 18 13:18:55 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF770BFA for ; Mon, 18 May 2015 13:18:55 +0000 (UTC) Received: from smtp-nf-106.his.com (smtp-nf-106.his.com [216.194.251.35]) by mx1.freebsd.org (Postfix) with ESMTP id 79F9616D3 for ; Mon, 18 May 2015 13:18:54 +0000 (UTC) Received: from cuda201.his.com (cuda201.his.com [216.194.248.226]) by smtp-nf-106.his.com (Postfix) with ESMTPS id 9ED2B60F8C for ; Mon, 18 May 2015 09:11:16 -0400 (EDT) X-ASG-Debug-ID: 1431954676-061c410b465c1220001-jLrpzn Received: from smtp-nf-202.his.com (smtp-nf-202.his.com [216.194.248.252]) by cuda201.his.com with ESMTP id i52ylhcFBXRGcGCp for ; Mon, 18 May 2015 09:11:16 -0400 (EDT) X-Barracuda-Envelope-From: dickey@his.com X-Barracuda-RBL-Trusted-Forwarder: 216.194.248.252 Received: from mail-sterling.his.com (mail-sterling.his.com [216.194.248.141]) by smtp-nf-202.his.com (Postfix) with ESMTP id 07A1B6013F for ; Mon, 18 May 2015 09:11:16 -0400 (EDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail-sterling.his.com (Postfix) with ESMTP id 68A783FF0004 for ; Mon, 18 May 2015 09:11:15 -0400 (EDT) X-Barracuda-RBL-Trusted-Forwarder: 216.194.248.141 X-Virus-Scanned: amavisd-new at mail-sterling.his.com Received: from mail-sterling.his.com ([127.0.0.1]) by localhost (mail-sterling.his.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00vKmYnlaHTD for ; Mon, 18 May 2015 09:11:11 -0400 (EDT) Received: from mail-sterling.his.com (mail-sterling.his.com [216.194.248.141]) by mail-sterling.his.com (Postfix) with ESMTP id A373C3FF0001 for ; Mon, 18 May 2015 09:11:11 -0400 (EDT) Date: Mon, 18 May 2015 09:11:11 -0400 (EDT) From: Thomas Dickey To: FreeBSD FreeBSD Message-ID: <1038227648.10325165.1431954671299.JavaMail.root@his.com> In-Reply-To: <20150518090051.6600f32a@seibercom.net> Subject: Re: Problem with sed MIME-Version: 1.0 X-ASG-Orig-Subj: Re: Problem with sed Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [66.28.220.34] X-Mailer: Zimbra 7.2.6_GA_2926 (ZimbraWebClient - FF3.0 (Win)/7.2.6_GA_2926) X-Barracuda-Connect: smtp-nf-202.his.com[216.194.248.252] X-Barracuda-Start-Time: 1431954676 X-Barracuda-URL: https://spam.his.com:443/cgi-mod/mark.cgi Received-SPF: pass (his.com: domain of dickey@his.com designates 216.194.248.141 as permitted sender) X-Virus-Scanned: by bsmtpd at his.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=7.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.19052 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2015 13:18:55 -0000 ----- Original Message ----- | From: "Jerry" | To: "FreeBSD FreeBSD" | Sent: Monday, May 18, 2015 9:00:51 AM | Subject: Problem with sed | | I rarely use sed, so I admit to not being fully acquainted with its | idiosyncrasies,; however, this one is really annoying. | | I am using this command in an attempt to remove empty lines: | | $ sed -i /^$/d /var/tmp/myfile.txt you have to quote the expression to prevent the '^' and '$' characters from being interpreted by the shell, for example sed -i '/^$/d' /var/tmp/myfile.txt -- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net