From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1KrjLG-0001hb-My for garchives@archives.gentoo.org; Mon, 20 Oct 2008 01:13:54 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A5AECE02A4; Mon, 20 Oct 2008 01:13:51 +0000 (UTC) Received: from bossdog.realss.com (bossdog.realss.com [211.157.114.130]) by pigeon.gentoo.org (Postfix) with ESMTP id 400E8E02A4 for ; Mon, 20 Oct 2008 01:13:51 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by bossdog.realss.com (Postfix) with ESMTP id 12F0B1C003E for ; Mon, 20 Oct 2008 09:13:59 +0800 (CST) Received: from bossdog.realss.com ([127.0.0.1]) by localhost (bossdog.realss.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 09828-09 for ; Mon, 20 Oct 2008 09:13:58 +0800 (CST) Received: from [192.168.1.101] (unknown [221.219.0.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by bossdog.realss.com (Postfix) with ESMTP id 9406C1C002F for ; Mon, 20 Oct 2008 09:13:58 +0800 (CST) Message-ID: <48FBDB4A.9070109@realss.com> Date: Mon, 20 Oct 2008 09:13:46 +0800 From: zhangweiwu@realss.com Organization: Real Softservice User-Agent: Thunderbird 2.0.0.14 (X11/20080621) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: [gentoo-user] how to word-wrap using a pipe? X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8 X-Virus-Scanned: amavisd-new at bossdog.realss.com Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 70fd8ab6-dfa5-4cff-931c-e0a2a6a17083 X-Archives-Hash: dd2eea9a708209a56e6c4744ec3a3b08 Hello. How can I line-wrap a text file that was not wrapped before (e.g. like text file created on Microsoft Windows's notepad, the software does softwrap by default, thus the file created using it often have very long text lines) by using command pipe? I could use vim, activate some formatting options and use gq. But that couldn't be used on a pipe. I could use groff, but that command line looks too complicated: $ head -n1 max_payne | groff -Tutf8 | grep --invert-match ^$ Life was good. A house on the Jersey side across the river. The smell of freshly cut lawns. The sounds of children playing. A beautiful wife and a baby girl. The American dream come true. But dreams have a nasty habit of going bad when you=E2=80=99re not looking. Besides groff wraps not according to the console term width, but according to the paper size in /etc/paper. It would be nice to have something wrap my text by using console width (what you get with '$ stty -a | head -n1') --=20 Real Softservice Huateng Tower, Unit 1788 Jia 302 3rd area of Jinsong, Chao Yang Tel: +86 (10) 8773 0650 ext 603 Mobile: 159 1111 7382 http://www.realss.com