From unknown Sun Jun 22 22:44:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13786: pr command does not fold Resent-From: Doh Smith Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 22 Feb 2013 17:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13786 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 13786@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.13615531596171 (code B ref -1); Fri, 22 Feb 2013 17:13:01 +0000 Received: (at submit) by debbugs.gnu.org; 22 Feb 2013 17:12:39 +0000 Received: from localhost ([127.0.0.1]:44556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U8wAl-0001bO-Li for submit@debbugs.gnu.org; Fri, 22 Feb 2013 12:12:39 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36169) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U8pfL-0007qK-Fp for submit@debbugs.gnu.org; Fri, 22 Feb 2013 05:15:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8pdu-00041V-VT for submit@debbugs.gnu.org; Fri, 22 Feb 2013 05:14:21 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:55066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8pdu-00041A-Rt for submit@debbugs.gnu.org; Fri, 22 Feb 2013 05:14:14 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8pdr-0001IL-Gs for bug-coreutils@gnu.org; Fri, 22 Feb 2013 05:14:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8pdo-0003nO-Ex for bug-coreutils@gnu.org; Fri, 22 Feb 2013 05:14:11 -0500 Received: from mail-wg0-f49.google.com ([74.125.82.49]:39544) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8pdo-0003mK-9H for bug-coreutils@gnu.org; Fri, 22 Feb 2013 05:14:08 -0500 Received: by mail-wg0-f49.google.com with SMTP id 15so388046wgd.16 for ; Fri, 22 Feb 2013 02:14:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=j4ptt2JFbSBVuaw2OeCXA966zm9oi2nqMNVzRw040IY=; b=HmWVf0kMv8Fy3qDbzsDnA6mXmPpV5GCFRn3YRCOEwzSApiQ/ihok82nH3OEiDRBjXf 8ttsgZJMSewCKfbMAJvzrTgqyGsoyhplbyjoVAGNt95ejXctEdhlSFWLNQ1oiYJjPo/h Zpkho6rRWnthvH0oRSTB/udNgbtoj8XTPViWKSFGfA8xN5TqkdPW1uoNIBFHfwR7ZP/A d0kBinVKrTJHkQ7ETZug+wp34i/1qIBrePld/DQ+W7dCCKSm7G/7iOD+Vfvm1yhIh8iF PMSbuDu9/qia1RLOLzXXN/JYNmSkK33OyAKJLNtlgzZjzaw0yJ7f5Bo9Dk4laZLwpq/h c5Lw== MIME-Version: 1.0 X-Received: by 10.180.92.129 with SMTP id cm1mr47786994wib.10.1361528046356; Fri, 22 Feb 2013 02:14:06 -0800 (PST) Received: by 10.227.196.207 with HTTP; Fri, 22 Feb 2013 02:14:06 -0800 (PST) Date: Fri, 22 Feb 2013 04:14:06 -0600 Message-ID: From: Doh Smith Content-Type: multipart/alternative; boundary=f46d043c7d148e3f3404d64d73ef X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-Mailman-Approved-At: Fri, 22 Feb 2013 12:12:33 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.7 (----) --f46d043c7d148e3f3404d64d73ef Content-Type: text/plain; charset=ISO-8859-1 Hi, I could not get the pr command to fold the lines. Is this a bug? I am using pr (GNU coreutils) 8.13 under GNU bash 4.2.24. Here is an example - the following pr command produced an output that instead of folding a long line of text in the first column, it cuts it off: $ echo "Snow with areas of blowing snow. Low around 24. East wind around 15 mph, with gusts as high as 25 mph. Chance of precipitation is 100%. Total nighttime snow accumulation of 2 to 4 inches possible." | pr -F --columns=2 2013-02-22 04:08 Page 1 Snow with areas of blowing snow. L D.S. --f46d043c7d148e3f3404d64d73ef Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

I could not get the pr command to fold the lines. Is this a bug?=

I am using pr (GNU coreutils) 8.13 under GNU bash 4.2.24.

H= ere is an example - the following pr command produced an output that instea= d of folding a long line of text in the first column, it cuts it off:

$ echo "Snow with areas of blowing snow.=A0 Low around 24. East wi= nd around 15 mph, with gusts as high as 25 mph.=A0 Chance of precipitation = is 100%. Total nighttime snow accumulation of 2 to 4 inches possible."= | pr -F --columns=3D2

2013-02-22 04:08=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 Page 1


Snow with areas of blowing snow.=A0 L<= br>
D.S.
--f46d043c7d148e3f3404d64d73ef-- From unknown Sun Jun 22 22:44:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13786: pr command does not fold Resent-From: Assaf Gordon Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 22 Feb 2013 19:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13786 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Doh Smith Cc: 13786@debbugs.gnu.org Received: via spool by 13786-submit@debbugs.gnu.org id=B13786.136156041924471 (code B ref 13786); Fri, 22 Feb 2013 19:14:02 +0000 Received: (at 13786) by debbugs.gnu.org; 22 Feb 2013 19:13:39 +0000 Received: from localhost ([127.0.0.1]:44663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U8y3v-0006Me-CM for submit@debbugs.gnu.org; Fri, 22 Feb 2013 14:13:39 -0500 Received: from mail-vc0-f174.google.com ([209.85.220.174]:51890) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U8y3s-0006MV-Qk for 13786@debbugs.gnu.org; Fri, 22 Feb 2013 14:13:37 -0500 Received: by mail-vc0-f174.google.com with SMTP id n11so614489vch.5 for <13786@debbugs.gnu.org>; Fri, 22 Feb 2013 11:12:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=1deV3j5mECESYhtKe7mbn1yFGeudMw0knXeDn6XHE08=; b=mfZGFSgRCQ8sQueroCItqxcZBkQt+YLi75FqkscE+u1SSBJ98HmtfM4yH2sP1QwJ20 R+PEmL18mCBpFKmOyi4gIjcZozJUYmllzFn1HYkPdWaKDXEJH6XbthTKco+XjHgeizKj QT845p4dSdvMMjMpinLPr5vXuhFgw/Mzw+pgTmywhPQdD2EXKvlip/MYtOkL7J7+4r/s DUbe7PtZ20PTMKTf8Vd6VH/i+jwustaeaa+ZYzwMyLfqk84MQgeOb/BXrYSGKDWDjo8L +GcsWk1EtCy9n+LKsgTDThpq5NkZ9Ut/lJci8NszkTVxGP61xEMggd2cVaWoAxlwHtD8 HhQw== X-Received: by 10.52.89.52 with SMTP id bl20mr3571976vdb.85.1361560332801; Fri, 22 Feb 2013 11:12:12 -0800 (PST) Received: from [143.48.11.9] (tango.cshl.edu. [143.48.11.9]) by mx.google.com with ESMTPS id kn18sm4963433veb.5.2013.02.22.11.12.10 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Feb 2013 11:12:11 -0800 (PST) Message-ID: <5127C30A.10803@gmail.com> Date: Fri, 22 Feb 2013 14:12:10 -0500 From: Assaf Gordon User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20120510 Icedove/10.0.4 MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hello, Doh Smith wrote, On 02/22/2013 05:14 AM: > I could not get the pr command to fold the lines. Is this a bug? > I am using pr (GNU coreutils) 8.13 under GNU bash 4.2.24. I think 'pr' does the pagination and columnation, but doesn't actual re-folds (=wraps) lines to your desired length. It is 'fmt' that can split long lines and join short lines. > > Here is an example - the following pr command produced an output that > instead of folding a long line of text in the first column, it cuts it off: > > $ echo "Snow with areas of blowing snow. Low around 24. East wind around > 15 mph, with gusts as high as 25 mph. Chance of precipitation is 100%. > Total nighttime snow accumulation of 2 to 4 inches possible." | pr -F > --columns=2 > > 2013-02-22 04:08 Page 1 > > > Snow with areas of blowing snow. L > Example with pr and fmt: ======================== $ TEXT="Snow with areas of blowing snow. Low around 24. East wind around 15 mph, with gusts as high as 25 mph. Chance of precipitation is 100%. Total nighttime snow accumulation of 2 to 4 inches possible." ## ## Re-fold into one column of 34 characters ## $ echo "$TEXT" | fmt -w 34 Snow with areas of blowing snow. Low around 24. East wind around 15 mph, with gusts as high as 25 mph. Chance of precipitation is 100%. Total nighttime snow accumulation of 2 to 4 inches possible. ## ## Columnate the text ## $ echo "$TEXT" | fmt -w 34 | pr -F --columns=2 2013-02-22 14:08 Page 1 Snow with areas of blowing snow. is 100%. Total nighttime snow Low around 24. East wind around accumulation of 2 to 4 inches 15 mph, with gusts as high as possible. 25 mph. Chance of precipitation ======= Notes: 1. 34 characters was chosen because the default page length of pr is 72 (and you want 2 columns + separator). 2. "pr -F" doesn't mean "fold", it means "use form-feed to separate pages" - just making sure you intended to use that. HTH, -gordon From unknown Sun Jun 22 22:44:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13786: pr command does not fold Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 22 Feb 2013 23:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13786 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Doh Smith Cc: 13786@debbugs.gnu.org Received: via spool by 13786-submit@debbugs.gnu.org id=B13786.136157515114854 (code B ref 13786); Fri, 22 Feb 2013 23:20:02 +0000 Received: (at 13786) by debbugs.gnu.org; 22 Feb 2013 23:19:11 +0000 Received: from localhost ([127.0.0.1]:44821 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U91tW-0003rV-Pw for submit@debbugs.gnu.org; Fri, 22 Feb 2013 18:19:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28783) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U91tU-0003rK-8q; Fri, 22 Feb 2013 18:19:09 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1MNHghB002052 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 22 Feb 2013 18:17:42 -0500 Received: from [10.36.116.35] (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r1MNHdnG015534 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 22 Feb 2013 18:17:41 -0500 Message-ID: <5127FC93.2050701@draigBrady.com> Date: Fri, 22 Feb 2013 23:17:39 +0000 From: =?UTF-8?Q?P=C3=A1draig?= Brady User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id r1MNHghB002052 X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) tag 13786 notabug close 13786 stop On 02/22/2013 10:14 AM, Doh Smith wrote: > Hi, > > I could not get the pr command to fold the lines. Is this a bug? > > I am using pr (GNU coreutils) 8.13 under GNU bash 4.2.24. > > Here is an example - the following pr command produced an output that > instead of folding a long line of text in the first column, it cuts it = off: > > $ echo "Snow with areas of blowing snow. Low around 24. East wind arou= nd > 15 mph, with gusts as high as 25 mph. Chance of precipitation is 100%. > Total nighttime snow accumulation of 2 to 4 inches possible." | pr -F > --columns=3D2 > > 2013-02-22 04:08 Page = 1 > > > Snow with areas of blowing snow. L fold or fmt are used to wrap text. It can then be passed on to pr for further layout and truncation: You can paste this command to a terminal for illustration: for i in $(seq 22); do clear seq -f '%03.f' 1 $i | fmt -w20 | pr -t -c2 -w40 -s'|' sleep 1 done thanks, P=E1draig.