From owner-freebsd-questions@FreeBSD.ORG Tue Sep 1 20:04:45 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 4EB8E1065676 for ; Tue, 1 Sep 2009 20:04:45 +0000 (UTC) (envelope-from prvs=488681940=pschmehl_lists@tx.rr.com) Received: from ip-relay-002.utdallas.edu (ip-relay-002.utdallas.edu [129.110.20.112]) by mx1.freebsd.org (Postfix) with ESMTP id 1FBC38FC0C for ; Tue, 1 Sep 2009 20:04:44 +0000 (UTC) X-Group: RELAYLIST X-IronPort-AV: E=Sophos;i="4.44,313,1249275600"; d="scan'208";a="15832659" Received: from smtp3.utdallas.edu ([129.110.20.110]) by ip-relay-002.utdallas.edu with ESMTP; 01 Sep 2009 15:04:41 -0500 Received: from utd65257.utdallas.edu (utd65257.utdallas.edu [129.110.3.28]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp3.utdallas.edu (Postfix) with ESMTPSA id A3BA24EF4A; Tue, 1 Sep 2009 15:04:41 -0500 (CDT) Date: Tue, 01 Sep 2009 20:04:41 +0000 From: Paul Schmehl To: FreeBSD Questions Message-ID: <744B6E6B195D8FF529A9281F@utd65257.utdallas.edu> In-Reply-To: <20090901185537.GA25956@brisbane.nepharia.org> References: <20090901185537.GA25956@brisbane.nepharia.org> X-Mailer: Mulberry/4.0.6 (Linux/x86) X-Munged-Reply-To: Figure it out MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: Mak Kolybabi Subject: Re: remove newlines from a file X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Paul Schmehl List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Sep 2009 20:04:45 -0000 --On Tuesday, September 01, 2009 13:55:37 -0500 Mak Kolybabi wrote: > > On 2009-09-01 18:03, 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? > > Personally, I'd use: > % tr -d '\n' < inputfile Personally, I like your solution. :-) -- 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