sed-devel
[Top][All Lists]
Advanced

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

sed what chars need \escape?


From: admin4
Subject: sed what chars need \escape?
Date: Sat, 21 Nov 2020 20:39:14 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3

Hello World,

thanks for all that is Free Software

wrote a little "online web based sed special char escape tool"

https://dwaves.org/tools/escape/ <https://dwaves.org/tools/escape/>

get mails once for improvement suggestions, latest mail was about if
ampersand & should be escaped \& as well? 

with this mail want to ask the people familiar with the matter if the
web based escape helper tool is "complete"

is the list of chars to escape complete?

# use cases: what will be escaped? (hit the escape button to test)
1) forward slash /
2) backward slash \
3) quotation mark "
4) single quotation mark '
5) opening brackets [
6) closing brackets ]
... anything missing? please report

thanks!


PS: as testing on GNU Debian 10 Linux shows (GNU sed)

ampersand does not need to be escaped

my sed test show that no escaping is needed to replace & with something else

e.g. test file contains:

&this&is&some&string

sed 's/&/WOHOO/g' test.sed.txt > output.txt;

cat output.txt

WOHOOthisWOHOOisWOHOOsomeWOHOOstring

-- 

best regards & live long and may free software prosper



reply via email to

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