[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] Thoughts: header/address parsing
From: |
Ralph Corderoy |
Subject: |
Re: [Nmh-workers] Thoughts: header/address parsing |
Date: |
Tue, 05 Aug 2014 11:51:34 +0100 |
Ken wrote:
> % scan -width 9999 -format '%{x-spam-status}' messages ....
Aside, it would be nice if scan's -width grew an "infinite" value as
9999 is a little kludgy. I was thinking `0', but that's not an error at
the moment, it seems to mean `The default is to use the width of the
terminal' -- http://git.savannah.gnu.org/cgit/nmh.git/tree/man/scan.man
So then I played a little bit.
$ scan -format '%{subject}' .
123456
$ scan -width 3 -format '%{subject}' .
12
Huh?
$ scan -width 1 -format '%{subject}' . | od -c
0000000 \n
0000001
$ scan -width 0 -format '%{subject}' . | od -c
0000000 1 2 3 4 5 6 \n
0000007
$
$ ed `mhpath .`
619
/123456/s/$/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxends
Subject:
123456xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxends
w
687
q
$ tput cols # MODE 7 FTW!
40
$ scan -width 0 -format '%{subject}' .
123456xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
$ scan -width 0 -format '%{subject}' . | wc -c
40
$
I think -width is avoiding printing in the last column to avoid an
unwanted linefeed? Either that, or it's out by one. I don't suppose
it's deliberately counting the `\n'.
Anyway, it's a bit off-putting to get `12' for a `-width 3', especially
after reading the fine man page.
Cheers, Ralph.
- [Nmh-workers] Thoughts: header/address parsing, Ken Hornstein, 2014/08/02
- Re: [Nmh-workers] Thoughts: header/address parsing, Ralph Corderoy, 2014/08/03
- Re: [Nmh-workers] Thoughts: header/address parsing, norm, 2014/08/03
- Re: [Nmh-workers] Thoughts: header/address parsing, Ken Hornstein, 2014/08/03
- Re: [Nmh-workers] Thoughts: header/address parsing, Lyndon Nerenberg, 2014/08/03
- Re: [Nmh-workers] Thoughts: header/address parsing, norm, 2014/08/04
- Re: [Nmh-workers] Thoughts: header/address parsing, Ken Hornstein, 2014/08/04
- Re: [Nmh-workers] Thoughts: header/address parsing,
Ralph Corderoy <=
- Re: [Nmh-workers] Thoughts: header/address parsing, norm, 2014/08/05
- Re: [Nmh-workers] Thoughts: header/address parsing, Jon Fairbairn, 2014/08/06
- Re: [Nmh-workers] Thoughts: header/address parsing, Ralph Corderoy, 2014/08/06
- Re: [Nmh-workers] Thoughts: header/address parsing, Ken Hornstein, 2014/08/06
- Re: [Nmh-workers] Thoughts: header/address parsing, Lyndon Nerenberg, 2014/08/04
- Re: [Nmh-workers] Thoughts: header/address parsing, Ken Hornstein, 2014/08/04
- Re: [Nmh-workers] Thoughts: header/address parsing, Lyndon Nerenberg, 2014/08/04