my current kind of unsolved problem with bash is how to replace all the characters in the [:punct:]
class, that is
[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]
, each with the same character escaped by a backslash. For example, I want ^h?e.l*l+o:
to become \^h\?e\.l\*l\+o\:
.
I can do it in a multi-liner fashion with loops. Is it possible to do it in a more succint and elegant way?
Thanks, Luca