i wrote a program that needed to convert human input to their binary rquivalent character code. if the human types
\
and
r
which results in a string of length 2 with
\r
in it. then my code converts that to a carriage return, the eqivalent of
chr(13)
. i made this handle all the sequences seen in
man ascii
as done in most Linux and most Unix. these are codes from 7 to 13. it also supports the sequences that begin with
^
making
^J
be character code 10 (newline) and
^[
be character code 27 (escape). i also added sequence
\xNN
where NN is interpreted as hexadecimal (documented in my code as "
cetal") and the sequence
\oMNN
where MNN is interpreted as octal. i wanted to add support for binary by doing
\bNNNNNNNN
but
\b
was already used (for character code 8, backspace).
the program takes the first argument as a screen (the
screen program) session name and the remaining arguments as input to that screen session. there is also a program to launch a background screen session (detached) with the specified name (required) and specified screen size (optional, default to the size this command is run in).
it also has support for
\dMNN
to interpret MNN as a decimal number for a character code as well as
\MNN
(digits 0, 1, 2, or 3 follow the
\
character) as a traditional octal form. letters may be given in either upper or lower case for all sequences.