[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sed: Invalid content of \{\}
From: |
Lawrence Velázquez |
Subject: |
Re: sed: Invalid content of \{\} |
Date: |
Sun, 18 Apr 2021 12:30:37 -0400 |
> On Apr 18, 2021, at 12:18 PM, michael-franzese@gmx.com wrote:
>
> Am trying to capture tho string within {}, but am getting
>
> sed: -e expression #1, char 19: Invalid content of \{\}
> sed: -e expression #1, char 19: Invalid content of \{\}
> sed: -e expression #1, char 19: Invalid content of \{\}
>
>
> a="{12..30..5}"
> fa=`echo $a | sed 's/.*(\{.*\}).*/\1/g'`
Aside from some GNU extensions, sed (without -E) uses POSIX basic
regular expressions. You should learn them instead of making
assumptions about which characters to escape and which not to.
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03
--
vq