Current-Users archive

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

Re: sed and xentools413



On Thu, 11 Mar 2021, Thomas Klausner wrote:

I also see problems building textproc/hunspell-de, but I don't understand the error:
...
sed: 1: "s/^ *\([0-9]*\)\t.*$/\1/": RE error: trailing backslash (\)

What is the trailing backslash in that regex?


The NetBSD sed doesn't understand '\t' as signifying a tab:

$ echo $'hello\tworld' | sed 's/\t/ /g' | sed -n l
hello\tworld$
$

You'll have to rewrite that regex like this:
$ nl /etc/motd | sed 's/^ *\([0-9]*\)'$'\t''.*$/\1/'
1

2

3
4
5
6

7
8
9
10

11

$

-RVP


Home | Main Index | Thread Index | Old Index