From your previous question we know that you're dealing with an older Ubuntu system and bash 3.2 version.
Some of the shells don't come with readline library support (see my related question about this), which is what causes the control characters to show up on screen. Good example of that is Korn shell and Dash. I couldn't find whether or not bash 3.2
comes with readline library support. I'll ask around to make sure.
However, based on the output of locate readline.so
you provided in the comments, it seems like your bash indeed is missing that library. Here's output of the same command from my system with bash 4.3.
$ locate readline.so
/lib/x86_64-linux-gnu/libreadline.so.5
/lib/x86_64-linux-gnu/libreadline.so.5.2
/lib/x86_64-linux-gnu/libreadline.so.6
/lib/x86_64-linux-gnu/libreadline.so.6.3
You could attempt to run set enable-keypad on
but I doubt this will have any effect without readline library present.
The obvious solution would be to upgrade bash, but since you need this system for infosec studies, i assume you might want to keep it as is.
I've asked a related question on unix.stackexchange.com. You can check if bash
uses readline
with nm
command , as shown in Thomas's answer
bash
version ?locate readline.so
return any files ?locate readline.so \n /lib/libreadline.so.5 \n /lib/libreadline.so.5.2 \n /usr/lib/python2.5/lib-dynload/readline.so