|
From: | GNU bug Tracking System |
Subject: | [debbugs-tracker] bug#28140: closed (Here is a possible bug in documentation for 4.4) |
Date: | Sun, 29 Oct 2017 03:29:02 +0000 |
Your message dated Sat, 28 Oct 2017 21:28:22 -0600 with message-id <address@hidden> and subject line Re: bug#28140: Here is a possible bug in documentation for 4.4 has caused the debbugs.gnu.org bug report #28140, regarding Here is a possible bug in documentation for 4.4 to be marked as done. (If you believe you have received this mail in error, please contact address@hidden) -- 28140: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=28140 GNU Bug Tracking System Contact address@hidden with problems
--- Begin Message ---Subject: Here is a possible bug in documentation for 4.4 Date: Fri, 18 Aug 2017 16:34:13 +0100 David L Wardmanual 4.4Best Wishes
section 7-8
sed -E ':x {N ; s/\n/ /g ; s/(.{40,40})/\1\n/ ; /\n/!bx ; P ;D}'
does not work as described. Change line length , say to 5
sed -E ':x {N ; s/\n/ /g ; s/(.{5,5})/\1\n/ ; /\n/!bx ; P ;D}'
cat line_wrap_input :
apple grape
pear peach
pomengranate
~/sed/code-> sed -E ':x {N ; s/\n/ /g ; s/(.{5,5})/\1\n/ ; /\n/!bx ; P ; D}' \ line_wrap_input
apple
grap
e pear peach pomengranate
~/sed/code->
This seems to work:
#!/bin/sed -rf
# line_wrap.sed (
:x
{
N
s/\n/ /g
:y
s_(.{40,40})_\1\n_
/.{40,40}/ P
s/.*\n//
ty
/\n/!bx
}
--- End Message ---
--- Begin Message ---Subject: Re: bug#28140: Here is a possible bug in documentation for 4.4 Date: Sat, 28 Oct 2017 21:28:22 -0600 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 On 2017-10-12 12:31 AM, Assaf Gordon wrote:On 18/08/17 09:34 AM, bamber ward wrote:manual 4.4 section 7-8 sed -E ':x {N ; s/\n/ /g ; s/(.{40,40})/\1\n/ ; /\n/!bx ; P ;D}' does not work as described.I'm thinking of the attached patch, which replaces the overly terse (and incorrect) example with a longer version with better comments.Push here: https://git.savannah.gnu.org/cgit/sed.git/commit/?id=490b4997 regards, - assaf
--- End Message ---
[Prev in Thread] | Current Thread | [Next in Thread] |