From owner-freebsd-questions@FreeBSD.ORG Tue Sep 1 20:45:53 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A9621065701 for ; Tue, 1 Sep 2009 20:45:53 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (gizmo.acns.msu.edu [35.8.1.43]) by mx1.freebsd.org (Postfix) with ESMTP id 5FB0D8FC08 for ; Tue, 1 Sep 2009 20:45:53 +0000 (UTC) Received: from gizmo.acns.msu.edu (localhost [127.0.0.1]) by gizmo.acns.msu.edu (8.13.6/8.13.6) with ESMTP id n81KEtQ6055035; Tue, 1 Sep 2009 16:14:55 -0400 (EDT) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: (from jerrymc@localhost) by gizmo.acns.msu.edu (8.13.6/8.13.6/Submit) id n81KEtM2055034; Tue, 1 Sep 2009 16:14:55 -0400 (EDT) (envelope-from jerrymc) Date: Tue, 1 Sep 2009 16:14:54 -0400 From: Jerry McAllister To: Paul Schmehl Message-ID: <20090901201454.GA54479@gizmo.acns.msu.edu> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i Cc: FreeBSD Questions Subject: Re: remove newlines from a file 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: Tue, 01 Sep 2009 20:45:53 -0000 On Tue, Sep 01, 2009 at 06:03:19PM +0000, Paul Schmehl wrote: > I found a sed tutorial once that did this, but I can't seem to find it > again. I have a file with multiple lines, each of which contains a single > ip followed by a /32 and a comma. I want to combine all those lines into a > single line by removing all the newline characters at the end of each line. > > What's the best/most efficient way of doing that in a shell? Use tr(1) something like tr -d "[\n]" < inputfile > outputfile ////jerry > > -- > Paul Schmehl, Senior Infosec Analyst > As if it wasn't already obvious, my opinions > are my own and not those of my employer. > ******************************************* > "It is as useless to argue with those who have > renounced the use of reason as to administer > medication to the dead." Thomas Jefferson > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"