Find the answer to your Linux question:
Results 1 to 2 of 2
i hv read abt the q parameter used with echo, as: echo -e "3[2q" it turns on the num lock key's LED, but it wont effect the num keypad. i ...
  1. #1
    Just Joined!
    Join Date
    Apr 2009
    Posts
    18

    Question echo with q parameter

    i hv read abt the q parameter used with echo, as:

    echo -e "\033[2q"

    it turns on the num lock key's LED, but it wont effect the num keypad. i wanna know is it only for the LEDs or it actually works? (same for 0q, 1q, 3q)

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    If I am not mistaken, those are VT100 control codes. Some terminal emulators are more or less compatible with the VT100 hardware terminals, but they are not VT100 terminals... I have no idea how these options will work on an emulator which is what xterm and friends are. Those codes were intended to control true hardware VT100 terminals.

    Some of them might not work at all.

    This has nothing to do with echo really. "q" is not a parameter for echo either, it's just part of the ESC sequence. You could try to print the same sequence with printf or any other tool and the result will be the same.

    Some of those sequences make very little sense in a fake terminal like xterm, since they are functions to control the hardware of an old VT100.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...