Thread: sed and hex
View Single Post
Old 15th July 2008
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Coming back to na5m's original question, perhaps something like this might do the trick. The idea is to use printf(1), which does support octal/hex notations, to write the sed command, and then use eval to execute the command:

Code:
eval $(printf "sed s/gratefull/grate\xYYfull/") document.txt
Here, YY represents the hex digits of the char you want, so you can specify it by number rather than some keysboard combination.
Reply With Quote