GNU bug report logs -
#47281
sed: problem with hex replace a literal '$'
Previous Next
Full log
View this message in rfc822 format
> Hello,
>
> the behavior you are describing is documented here:
> https://www.gnu.org/software/sed/manual/sed.html#Escaping-Precedence
>
> If you want to produce a basic regular
> expression given a string to be matched
> literally, precede any of $*.[\]^ with \
> Likewise, if you are using hex escapes (\xHH),
> precede any of \x24 \x2a \x2e \x5b \x5c \x5d \x5e with \x5c
Hi Nora,
thanks for your help suggesting the escaping.
I understand, that this behaviour is valid and not a bug.
Maybe you can post this to the Mailingslist as well,
i'am not subscribed there.
Indeed this is really awkward, but I have to
accept that and use now something like that:
#!/bin/sh
#
# [...]
#
# case "$hex" in
# 24|2a|2e|5b|5c|5d|5e)
# hex="5c\x$hex"
# ;;
# esac
see:
https://github.com/bittorf/kritis-linux/commit/d3cc6c84a6c021ae2f7e9351f9f4ef0fc7098c0b
Thanks again & bye,
Bastian Bittorf
This bug report was last modified 4 years and 86 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.