how Unix shells typically display the escape character; in ASCII, decimal 31, hex 1b, octal 37.
If you want to type one, you need to tell your current editing environment that you want to insert a special character; in vi, csh, and bash, you do this by hitting Control-v, followed by the special character - in this case, the Escape key. In Emacs, Control-q followed by the Escape key will do the trick, as well as "M-x quoted-insert", followed by the Escape key. (Seeing as C-q is just bound to quoted-insert by default anyway...)
In ksh, you .... actually, I don't know how to do it in ksh - if you know how, let me know!