Skip to content
Advertisement

sed replace with hex

UTF-8 file test.txt:

JavaScript

hex is

JavaScript

sed s/A/B/g test.txt works

sed s/x41/B/g test.txt does not work

Some characters are unprintable so I must use their hex, A is just an example.

Advertisement

Answer

the shell preprocesses it, use single quotes.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement