From owner-freebsd-questions@FreeBSD.ORG Mon May 18 13:13:44 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 20EA2AB3 for ; Mon, 18 May 2015 13:13:44 +0000 (UTC) Received: from mx1.bocal.org (mx1.bocal.org [163.5.69.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 014DA168E for ; Mon, 18 May 2015 13:13:42 +0000 (UTC) Received: from mx1.bocal.org (localhost [127.0.0.1]) by mx1.bocal.org (OpenSMTPD) with ESMTP id af9b975f for ; Mon, 18 May 2015 15:06:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bocal.org; h=date:from:to :subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=xHSyjwvquAK+ xg/pqVNiYvkxknU=; b=cFxyi2roun2KF+vZDNYE1twyUdc+HjNrwaJ5DnfRUb3o M7moklPesqmFOspijPNTnODoPsTz+k5Opk7lNsneWKgSrdsAn8d6//tmmG31LJZw IVwbiW/bhRRH2AuUS279wFWAELhWzzYYz1VV1SrkF9tKUY9wCgONzvDD27Q4BRE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bocal.org; h=date:from:to :subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=5OcuGh NNBwUzYeo+LDIyBiMKr87CUT7qHM2JPCzwW2npxfTTHdqj9DJbsVrpTU+3CsboV8 UZR1oC3UbVvDH5qx0+EjKABH9WeoFe6GNwerU2cPOMypaavdCvBKav6UIkaK5oui mOJtt5wOl7zxYax6u7sXN+6sSOBBmdQwxAECc= Received: from atlantis.staff.bocal.org (163.5.250.96 [163.5.250.96]) by smtp.bocal.org (OpenSMTPD) with ESMTPSA id d6985648 TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO for ; Mon, 18 May 2015 15:06:46 +0200 (CEST) Date: Mon, 18 May 2015 15:06:45 +0200 From: Emmanuel Vadot To: FreeBSD FreeBSD Subject: Re: Problem with sed Message-Id: <20150518150645.0aaf7b513526c4f2a11d85e7@bocal.org> In-Reply-To: <20150518090051.6600f32a@seibercom.net> References: <20150518090051.6600f32a@seibercom.net> X-Mailer: Sylpheed 3.4.2 (GTK+ 2.24.27; amd64-portbld-freebsd10.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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:13:44 -0000 -i is for backup file Use -i"" if you don't want any backup and replace in file Use -i.bak for example to backup the original file as file.bak On Mon, 18 May 2015 09:00:51 -0400 Jerry wrote: > 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 > > and get this error: > > sed: 1: "/var/tmp/myfile.txt": undefined label 'mp/myfile.txt' > > I don't understand why. I am following the example I found in the "sed & awk" handbook by "O'Reilly" -- Emmanuel Vadot