shell for READKEY
I would like to write a shell to read a UP, DOWN, LEFT and RIGHT key in and output a corresponding message. However, I found "read" function don't know how to read the special key as the key value. Does anyone have idea?
I don't think there is a "special value", just some odd characters.
[root@mofo X11]# cat -v -
(I typed the up arrow key, then the return key, then Ctl-d.)
So, up arrow is Ctl-[, followed by [, followed by A.
You may need to turn off command line editing with --noediting
when starting the shell, or you may never see the keys used for editing...
Have your script start with
|All times are GMT -5. The time now is 04:22 AM.|