[Bug 253893] sed "/^\s*$/d" complains about trailing backslash (\)

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 11 Jun 2021 13:37:10 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253893

--- Comment #12 from Ed Maste <emaste@freebsd.org> ---
(In reply to David Schlachter from comment #3)
> printf "\n\n\n\n" | sed "/^\s*$/d"

Note that this is not actually testing \s since we're matching 0 or more. For
example, try (on 12.x or earlier):

$ printf "\n\n\n\n" | sed "/^x*$/d"

This also deletes the blank lines. Or, try:

$ printf " \n \n \n \n" | sed "/^\s*$/d"

and observe that the except-for-whitespace empty lines are not stripped.

-- 
You are receiving this mail because:
You are the assignee for the bug.