Question
Write a C program mywrite whose behavior resembles that of the system command write. mywrite accepts the following parameters: $ mywrite username ttyname ; username
Write a C program mywrite whose behavior resembles that of the system command write.
mywrite accepts the following parameters: $ mywrite username ttyname; username is a name of the user logged into a terminal ttyname.
mywrite operates by copying lines from stdin of your terminal to stdout of the username's terminal.
Every line typed by the sender must be displayed at the receiver's terminal immediately after the sender presses the Enter key or closes the connection.
The first line to be displayed on the username's terminal will look like this: Message from yourname@yourhost on yourtty
When the user who started mywrite presses Ctrl-D (EOF), mywrite closes the connection and displays the final message on the username's terminal: EOF
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started