GNU bug report logs - #27128
fold -b wants no immediate space, otherwise mistakes number as filename

Previous Next

Package: coreutils;

Reported by: openforum <at> davidpbrown.co.uk

Date: Mon, 29 May 2017 16:00:03 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 27128 in the body.
You can then email your comments to 27128 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#27128; Package coreutils. (Mon, 29 May 2017 16:00:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to openforum <at> davidpbrown.co.uk:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Mon, 29 May 2017 16:00:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: davidpbrown <openforum <at> davidpbrown.co.uk>
To: bug-coreutils <at> gnu.org
Subject: fold -b wants no immediate space, otherwise mistakes number as
 filename
Date: Mon, 29 May 2017 16:42:53 +0100
coreutils v 8.25-2ubuntu2

fold -b error wanting no space before the number, inconsistent with
expectation and -w


Error:

$ echo "abcdefghijklm"  | fold -b 6
fold: 6: No such file or directory


inconsistent with -w

$ echo "abcdefghijklm"  | fold -w6
abcdef
ghijkl
m

$ echo "abcdefghijklm"  | fold -w 6
abcdef
ghijkl
m


but works with:

$ echo "abcdefghijklm"  | fold -b6
abcdef
ghijkl
m


Regards
davidpbrown




Information forwarded to bug-coreutils <at> gnu.org:
bug#27128; Package coreutils. (Mon, 29 May 2017 19:32:02 GMT) Full text and rfc822 format available.

Message #8 received at 27128 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: openforum <at> davidpbrown.co.uk, 27128 <at> debbugs.gnu.org
Subject: Re: bug#27128: fold -b wants no immediate space, otherwise mistakes
 number as filename
Date: Mon, 29 May 2017 12:31:13 -0700
tag 27128 notabug
close 27128
stop

On 29/05/17 08:42, davidpbrown wrote:
> coreutils v 8.25-2ubuntu2
> 
> fold -b error wanting no space before the number, inconsistent with
> expectation and -w
> 
> 
> Error:
> 
> $ echo "abcdefghijklm"  | fold -b 6
> fold: 6: No such file or directory
> 
> 
> inconsistent with -w
> 
> $ echo "abcdefghijklm"  | fold -w6
> abcdef
> ghijkl
> m
> 
> $ echo "abcdefghijklm"  | fold -w 6
> abcdef
> ghijkl
> m
> 
> 
> but works with:
> 
> $ echo "abcdefghijklm"  | fold -b6
> abcdef
> ghijkl
> m

What's happening here is that fold(1) supports arguments
of the form `fold -80`. That's undocumented
since it's legacy and supported only for compat with old scripts.
Therefore -b6 is equivalent to -b -6 which is supported:

$ echo "abcdefghijklm"  | src/fold -b -6
abcdef
ghijkl
m

The documented form for what you want to do is:

echo "abcdefghijklm"  | src/fold -b -w6
abcdef
ghijkl
m

thanks,
Pádraig




Added tag(s) notabug. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Mon, 29 May 2017 20:06:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 27128 <at> debbugs.gnu.org and openforum <at> davidpbrown.co.uk Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Mon, 29 May 2017 20:06:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 27 Jun 2017 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 355 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.