groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Old version of vgrind no longer working


From: Ralph Corderoy
Subject: Re: Old version of vgrind no longer working
Date: Sun, 25 Dec 2022 07:17:20 +0000

Hi Damian,

>       echo "$i" | sed -e 's%[[./*$^\\]%\\&%g' -e 's%.*%/^&:/d%'
...
>       sed: -e expression #1, char 18: unterminated `s' command

It's the first expression which is the problem.

    $ sed -e 's%[[./*$^\\]%\\&%g' </dev/null
    sed: -e expression #1, char 18: unterminated `s' command
    $ sed -e 's%.*%/^&:/d%' </dev/null
    $

That's using the sed 4.7-1 package on Arch Linux.

It's because ‘[’ represents itself inside a character class unless it's
followed by a colon, dot, or equals because then it looks like the start
of a ‘[:digit:]’ or similar.  Re-ordering works:

    $ sed -e 's%[.[/*$^\\]%\&%g' </dev/null
    $

-- 
Cheers, Ralph.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]