GNU bug report logs - #20571
sed 4.2.2

Previous Next

Package: sed;

Reported by: Massimo Masotti <max.mas <at> libero.it>

Date: Thu, 14 May 2015 09:17:02 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

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 20571 in the body.
You can then email your comments to 20571 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-sed <at> gnu.org:
bug#20571; Package sed. (Thu, 14 May 2015 09:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Massimo Masotti <max.mas <at> libero.it>:
New bug report received and forwarded. Copy sent to bug-sed <at> gnu.org. (Thu, 14 May 2015 09:17:02 GMT) Full text and rfc822 format available.

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

From: Massimo Masotti <max.mas <at> libero.it>
To: bug-sed <at> gnu.org
Subject: sed 4.2.2
Date: Thu, 14 May 2015 10:19:43 +0200 (CEST)
[Message part 1 (text/plain, inline)]
Good morning,

the file contains "8.25F, \n". I notice a strange behavior with this line:

sed -i -r 's/([0-9])F([,; \]\}\)])/\1\2/g'  file

while I'm expecting to get "8.25, \n", the content is not changed. To get the expected substitution, I must use:

sed -i -r 's/([0-9])F([,; \}\)])/\1\2/g'  file

as if it is not legal to use the escaped character  ']'.

Thanks for your time; I apologize if I'm wrong.

Best Regards


Massimo Masotti - Italy





[Message part 2 (text/html, inline)]

Information forwarded to bug-sed <at> gnu.org:
bug#20571; Package sed. (Thu, 14 May 2015 10:29:02 GMT) Full text and rfc822 format available.

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

From: Davide Brini <dave_br <at> gmx.com>
To: bug-sed <at> gnu.org
Subject: Re: bug#20571: sed 4.2.2
Date: Thu, 14 May 2015 12:28:41 +0200
On Thu, 14 May 2015 10:19:43 +0200 (CEST), Massimo Masotti
<max.mas <at> libero.it> wrote:

> Good morning,
> 
> the file contains "8.25F, \n". I notice a strange behavior with this line:
> 
> sed -i -r 's/([0-9])F([,; \]\}\)])/\1\2/g'  file
> 
> while I'm expecting to get "8.25, \n", the content is not changed. To get
> the expected substitution, I must use:
> 
> sed -i -r 's/([0-9])F([,; \}\)])/\1\2/g'  file
> 
> as if it is not legal to use the escaped character  ']'.

If you want to use a "]" inside a bracket expression, specify it as the
very first character (after the ^ negation, if present, but that's not
your case). And you don't need to escape } and ) inside the bracket
expression, so

sed -i -r 's/([0-9])F([],; })])/\1\2/g'  file

Here what's inside the [] is 

],; })


-- 
D.




Reply sent to Jim Meyering <jim <at> meyering.net>:
You have taken responsibility. (Thu, 14 May 2015 15:07:02 GMT) Full text and rfc822 format available.

Notification sent to Massimo Masotti <max.mas <at> libero.it>:
bug acknowledged by developer. (Thu, 14 May 2015 15:07:03 GMT) Full text and rfc822 format available.

Message #13 received at 20571-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Davide Brini <dave_br <at> gmx.com>
Cc: 20571-done <at> debbugs.gnu.org
Subject: Re: bug#20571: sed 4.2.2
Date: Thu, 14 May 2015 08:05:54 -0700
tags 20571 notabug
thanks

On Thu, May 14, 2015 at 3:28 AM, Davide Brini <dave_br <at> gmx.com> wrote:
> On Thu, 14 May 2015 10:19:43 +0200 (CEST), Massimo Masotti
> <max.mas <at> libero.it> wrote:
>
>> Good morning,
>>
>> the file contains "8.25F, \n". I notice a strange behavior with this line:
>>
>> sed -i -r 's/([0-9])F([,; \]\}\)])/\1\2/g'  file
>>
>> while I'm expecting to get "8.25, \n", the content is not changed. To get
>> the expected substitution, I must use:
>>
>> sed -i -r 's/([0-9])F([,; \}\)])/\1\2/g'  file
>>
>> as if it is not legal to use the escaped character  ']'.
>
> If you want to use a "]" inside a bracket expression, specify it as the
> very first character (after the ^ negation, if present, but that's not
> your case). And you don't need to escape } and ) inside the bracket
> expression, so
>
> sed -i -r 's/([0-9])F([],; })])/\1\2/g'  file
>
> Here what's inside the [] is
>
> ],; })

Thanks for helping, Davide.
Massimo, I'm marking this as "notabug" and closing the auto-filed issue.




Information forwarded to bug-sed <at> gnu.org:
bug#20571; Package sed. (Thu, 14 May 2015 15:19:02 GMT) Full text and rfc822 format available.

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

From: Massimo Masotti <max.mas <at> libero.it>
To: <20571 <at> debbugs.gnu.org>
Subject: R: bug#20571: closed (Re: bug#20571: sed 4.2.2)
Date: Thu, 14 May 2015 17:18:13 +0200 (CEST)
Hi,

thanks for the explanation, even if a mathematical set, as it is inside [   ], 
would be position independent.

Kind Regards


Massimo Masotti


>----Messaggio originale----
>Da: help-debbugs <at> gnu.org
>Data: 14/05/2015 17.07
>A: "Massimo Masotti"<max.mas <at> libero.it>
>Ogg: bug#20571: closed (Re: bug#20571: sed 4.2.2)
>
>Your bug report
>
>#20571: sed 4.2.2
>
>which was filed against the sed package, has been closed.
>
>The explanation is attached below, along with your original report.
>If you require more details, please reply to 20571 <at> debbugs.gnu.org.
>
>-- 
>20571: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20571
>GNU Bug Tracking System
>Contact help-debbugs <at> gnu.org with problems
>






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

This bug report was last modified 10 years and 91 days ago.

Previous Next


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