[BRLTTY] Appending NUL to cat

james collins james.collins75 at gmail.com
Mon Sep 28 15:09:57 EDT 2009


Thanks for the responses. To make a script out of the lines you gave  
me, would I write in a text editor, first line:
#!/bin/sh
How would I invoke this script, like let's say I made a script, and  
called it samplescript.txt, if I was in the directory where it was  
located I would say:
sh ./samplescript.txt
what would happen next? In the script cat never gets called? Would my  
cursor drop down a line and I would enter text? And when I hit return  
a NUL character would be appended to the end of the text? And then if  
I hit cntrl-c it would exit cat?

Sent from my iPhone

On Sep 28, 2009, at 1:46 PM, Michael Whapples <mwhapples at aim.com> wrote:

> 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

On my phone it is written as four lines?
>
> 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.
>>
>>
>
> _______________________________________________
> This message was sent via the BRLTTY mailing list.
> To post a message, send an e-mail to: BRLTTY at mielke.cc
> For general information, go to: http://mielke.cc/mailman/listinfo/brltty


More information about the BRLTTY mailing list