ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
My question deals with me creating a name pipe (file) in the my /group directory called chat.
I then have to write a script to read from the named pipe and save data into a file called chat.log until the words End of File are passed to the program.
-When I created the named pipe file (chat) I used the mknod chat p command..Is this the correct command to create a named pipe file?
-Then I'm having trouble with my script and how to make it run until the words End of File are entered in. This is what I have so far...
The script is not putting any data into the chat.log file. Is it better if I use a while or until loop? I was thinking a until loop would be better since I want the script to run until the words End of File are passed to the program.But I'm not sure what would be the easiest or best way? Yes I have this for my one class I'm taking right now...I don't want you to give me the script or anything, I just wanted to get some help because I'm just getting into writing scripts..Thanks again.
In case the fifo does not exist or breaks, the best option is to use while read. The normal termination on reading "End of File" will have to come after the read (so you've got a line to examine) and before writing to file (because you don't want to write anything if you just read "End of File").