[BRLTTY] Appending NUL to cat

Michael Whapples mwhapples at aim.com
Mon Sep 28 13:46:35 EDT 2009


You can do what you are asking for in three lines:

while read myline ; do
echo -e -n "$myline\00" >/dev/cu.usbserial-FTKVMAFF
done

For convenience you may want to put those three lines in a text file to 
make a script.

Michael Whapples
On 28/09/09 18:06, Dave Mielke wrote:
> [quoted lines by james collins on 2009/09/28 at 12:29 -0400]
>
>    
>> Just wondering what I am doing wrong? I want to use cat, but I want to
>> append a NUL character to what I type? I tried typing:
>> echo -e -n '\000' | cat>  /dev/cu.usbserial -FTKVMAFF
>> What I was hoping would happen, is my cursor would drop down a line
>> and I would be in the cat command, I would then right some text and
>> when I hit return, a NUL character would be appended to the text I had
>> written and my synthesizer would speak the words I had written?
>>      
> I think you mustn't be very familiar with Unix-style operating systems.
>
> When you join two commands with |, what you're doing is redirecting the input
> of the second command (in your case, cat) away from your keyboard and to the
> output of the first command (in your case, echo).
>
> There's no magic way to do what you're wanting to do. If you want a NUL
> appended to each line you type before that line is written to your synthesizer
> then you're going to have to write a simple program to do exactly that. In this
> case, a fairly simple shell script should suffice.
>
>    



More information about the BRLTTY mailing list