[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 回复: report a bug of the function of patsplit
From: |
Andrew J. Schorr |
Subject: |
Re: 回复: report a bug of the function of patsplit |
Date: |
Tue, 18 Aug 2020 16:32:08 -0400 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hi,
Please always respond to the list instead of privately.
You answered half of my question, but not the more important half: how
do the results differ from what you expect? As Wolfgang pointed out,
the patsplit function seems to be working correctly, as far as I can tell.
And yes -- you should upgrade to the newest version of gawk.
Regards,
Andy
On Wed, Aug 19, 2020 at 04:27:14AM +0800, 天骄之鹰 wrote:
>
> My system informations:
>
>
> // awk version
> [root@novice ~]# awk --version
> GNU Awk 4.2.1, API: 2.0 (GNU MPFR 3.1.6-p2, GNU MP 6.1.2)
> Copyright (C) 1989, 1991-2018 Free Software Foundation.
>
> This program is free software; you can redistribute it and/or modify
> it under the terms of the GNU General Public License as published by
> the Free Software Foundation; either version 3 of the License, or
> (at your option) any later version.
>
> This program is distributed in the hope that it will be useful,
> but WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> GNU General Public License for more details.
>
> You should have received a copy of the GNU General Public License
> along with this program. If not, see http://www.gnu.org/licenses/.
>
>
> // my OS informations:
> [root@novice ~]# uname -a
> Linux novice 4.18.0-193.14.2.el8_2.x86_64 #1 SMP Sun Jul 26 03:54:29 UTC 2020
> x86_64 x86_64 x86_64 GNU/Linux
> [root@novice ~]#
> OS = centos8.1
>
>
> I think that the bug of patsplit maybe repair in the new versions. thank you
> for your reply. good luck.
>
>
>
> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
> ž
>
>
>
> ------------------ ԭʼ ------------------
> : "Andrew J. Schorr" <aschorr@telemetry-investments.com>;
> ʱ : 2020 8 18 ( ) 11:34
> : " ֮ӥ"<tianjiaozhiying@qq.com>;
> : "bug-gawk"<bug-gawk@gnu.org>;
> : Re: report a bug of the function of patsplit
>
> Hi,
>
> Thanks for the bug report. Which version of gawk are you using, and how do the
> results differ from what you expect?
>
> Regards,
> Andy
>
> On Tue, Aug 18, 2020 at 01:25:16PM +0800, ֮ӥ wrote:
> > Hi, guys:
> >
> >
> > I find that the function of patsplit has a bug.
> >
> >
> > patsplit(string, array [, fieldpat[, seps]]) : To save pieces
> into 'array', store separator into 'seps'. But this function saves pieces into
> 'seps', not strore into 'array'
> >
> >
> >
> >
> >
> >
> > // souce codes
> > [root@novice commands]# echo "chinaos cnaps mmnasten" | gawk '{ patsplit($0,
> arr,"na", sepp )} END{ for( x in arr){ print "arr[" x "]=" arr[x]}; for( y in
> sepp){ print "sepp[" y "]=", sepp[y]}}'
> > arr[1]=na
> > arr[2]=na
> > arr[3]=na
> > sepp[0]= chi
> > sepp[1]= os c
> > sepp[2]= ps mm
> > sepp[3]= sten
> >
> >
> >
> > [root@novice commands]# echo "chinaos cnaps mmnasten" | gawk '{ patsplit($0,
> arr,"na", sepp )} END{ for( x in arr){ print "arr[" x "]=" arr[x]}; for( y in
> sepp){ print "sepp[" y "]=", sepp[y]}}'
> > arr[1]=na
> > arr[2]=na
> > arr[3]=na
> > sepp[0]= chi
> > sepp[1]= os c
> > sepp[2]= ps mm
> > sepp[3]= sten
> >
> >
> >
> >
> >
> > Good luck.
> >
> > ž
> >
> >
> >
--
Andrew Schorr e-mail: aschorr@telemetry-investments.com
Telemetry Investments, L.L.C. phone: 917-305-1748
152 W 36th St, #402 fax: 212-425-5550
New York, NY 10018-8765
Re: report a bug of the function of patsplit, arnold, 2020/08/19