Help with writing a c program
Imported from the Apple Support Forums via the Wayback Machine 🔗
Hello,
I want to write a c program, but could use some help. I want to write a program that will add a NUL character to each line? I want to have a NUL character put on the end of text either written or read to the file? In terminal the keystroke to write a NUL character is cntrl shift @. With the help of others I have written a shell script that when executed uses the echo command, there was a variable in it and then 0 was added to the end of the variable. And the script worked, when I would run the script my cursor would drop down a line, I could then enter text and when I hit return a NUL character would be automatically added to the text I had written. I confirmed this because my serial device a speech synthesizer spoke the text I had written. I could after I hit return type another line of text or press cntrl d to exit the shell script. I have been trying to figure out a way to have a complete unix session spoken by my serial port device. I got ckermit a terminal emulator, and using certain ckermit commands was able to transmit a text file (which based on how I saved the file must have ended with a NUL because my synthesizer spoke some files I transmitted, and other files it didn't speak). I also used the ckermit lineout command to send text directly to my device, and that worked. I then tried ckermits log session command to send a whole unix session to my synthesizer. And so far I haven't been able to get audio output? So I want to write a c program, that will add a NUL character to the end of a line sent to my synthesizer. I don't know if I need a NUL at the end of text on each line, or just at the very end of text? i.e. if I do ls, would I need to put a NUL at the end of each line, or just at the very end of the ls listing? btw ls is just an example if possible I want my program when I am running it to work with a complete unix session i.e. pwd would produce my synthesizer speaking my current working directory. I really don't know where to begin, I think I would use printf but I don't know where to start? Any help would be appreciated.
15 replies
Sign in or join Beachball Help to reply.
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0