From owner-freebsd-questions@FreeBSD.ORG Wed Sep 2 06:51:01 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 E1EC51065672 for ; Wed, 2 Sep 2009 06:51:01 +0000 (UTC) (envelope-from j.mckeown@ru.ac.za) Received: from b.mail.ru.ac.za (b.mail.ru.ac.za [IPv6:2001:4200:1010::25:2]) by mx1.freebsd.org (Postfix) with ESMTP id 295A58FC12 for ; Wed, 2 Sep 2009 06:51:01 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=ru-msa; d=ru.ac.za; h=Received:To:Subject:Content-Disposition:From:Organization:X-Face:Date:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:X-Virus-Scanned:X-Authenticated-User; b=ZYNxNDaNMvClKXaHnESh6zpBWy7Ei4xNT6LcGzFNmSQW33QxRtYK7iyw4GsjA/tZW1DOHhkmxlDMQhxAtsxp9LUnoqyKKXWvCHyWyZ9Wxh1de5Mxk74uW75HMntWuPYx; Received: from vorkosigan.ru.ac.za ([2001:4200:1010:1058:219:d1ff:fe9f:a932]:54815) by b.mail.ru.ac.za with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1MijgJ-000KPJ-7g for freebsd-questions@freebsd.org; Wed, 02 Sep 2009 08:50:59 +0200 To: freebsd-questions@freebsd.org Content-Disposition: inline From: Jonathan McKeown Organization: Rhodes University X-Face: $@VrUx^RHy/}yu]jKf/<4T%/d|F+$j-Ol2"2J$q+%OK1]&/G_S9(=?iso-8859-1?q?HkaQ*=60!=3FYOK=3FY!=27M=60C=0A=09aP=5C9nVPF8Q=7DCilHH8l?= =?iso-8859-1?q?=3B=7E!42HK6=273lg4J=7Daz?=@1Dqqh:J]M^"YPn*2IWrZON$1+G?oX3@ =?iso-8859-1?q?k=230=0A=0954XDRg=3DYn=5FF-etwot4U=24b?=dTS{i X-Virus-Scanned: b.mail.ru.ac.za (2001:4200:1010::25:2) X-Authenticated-User: s0900137 from vorkosigan.ru.ac.za (2001:4200:1010:1058:219:d1ff:fe9f:a932) using auth_plaintext 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: Wed, 02 Sep 2009 06:51:02 -0000 [Arrrrgghh. To list this time] On Tuesday 01 September 2009 20:03:19 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? I'd use rs(1).