Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

UNIX: Create a script in C Shell that can be executed only from a specific termi

ID: 3813386 • Letter: U

Question

UNIX: Create a script in C Shell that can be executed only from a specific terminal.

Create a script that prints a friendly message. However, the script can be executed only from one terminal. You can use the name of the terminal you are using when you write the script (Note: All of our terminals are “soft” – so this assignment doesn’t make sense – just go ahead and use any pts numbered terminal). If somebody uses the script from a terminal that is not authorized, the script exits immediately. Hint: Use the tty command to find the current terminal. Think of this script as a front-end for scripts that need to executed on a secure terminal. This would mean that the friendly message would eventually be replaced with the body of the script.
Use the tty command to determine the user’s current terminal.

Explanation / Answer

Echo "The message that u want to print WL be here"

The echo command is used to give a message or prints the string on the console I.e, terminal.

We will get the current terminal by using the command tty.

We WL just place that terminal I'd in the script to run that scrip in only the particular script.