I am trying to get into UNIX. I want to replace and -
, ?
, :
, /
, &
to become %5f
, %3f
%3a
, %2f
, %26
, %20
(these are the hexadecimal digits corresponding to the ASCII code).
I am also trying to make any lower case characters become upper case and vice versa, e.g. the rock
to become THE ROCK
and THE ROCK
to become the rock
.
I am trying to do this all using standard UNIX utilities commands using a script, ideally all on one line.
So far I have got
tr A-Z a-z
but not sure how to make the ?
and the other ones spit out the corresponding hex #s.