LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   escape characters in Linux (https://www.linuxquestions.org/questions/programming-9/escape-characters-in-linux-843747/)

apeselis 11-11-2010 02:57 PM

escape characters in Linux
 
My goal is to send escape characters from Linux to make scanner's LED blink. I've started with a simple "beep" command:
echo -e "\07"

and it worked. We are using WaveLink emulator and the escape sequences for the LED are
echo -e "\033%150;200;5L"

Linux returns me this: 150;200;5L
So, it doesn't work. What am I doing wrong for the LED sequences?

neonsignal 11-11-2010 04:16 PM

Quote:

Originally Posted by apeselis (Post 4156124)
echo -e "\033%150;200;5L"
Linux returns me this: 150;200;5L
So, it doesn't work. What am I doing wrong for the LED sequences?

You aren't doing anything wrong, it is just that the \033 has a special meaning when echoed to a terminal. If you want to really view what the echo generates, perhaps you can use od to dump it, for example:
Code:

echo -e "\033%150;200;5L" | od -b
which will give you an octal dump of the byte sequence:
Code:

0000000 033 045 061 065 060 073 062 060 060 073 065 114 012


All times are GMT -5. The time now is 07:46 PM.