Use the Linux command

Use the Linux command

make a function that uses a case statement with the parameters below.

The function will be called captainPrinterYourName.

Example: captainPrinterRebecca ()

You should prompt the user for their name.

The following names will be used in your case statement:

Captain Pike

Captain Picard

Captain Janeway

Captain Kirk

Captain Your Name (replace Your Name with your actual name)

Any other input

If the user types Captain Pike, make a printer called Enterprise1 with the IP address of 172.16.19.1. Echo a greeting to this user.

If the user types Captain Picard, make a printer called Enterprise2 with the IP address of 172.16.19.2. Echo a greeting to this user.

If the user types Captain Janeway, make a printer called Enterprise3 with the IP address of 172.16.20.3. Echo a greeting to this user.

If the user types Captain Kirk make a printer called Enterprise4 with the IP address of 172.16.21.4. Echo a greeting to this user.

If the user types Captain Your Name, make a printer called Enterprise5 with the IP address of 172.16.22.5. Echo a greeting to this user.

If the user types any other name, echo a response that they are not authorized to use the printer in the captain’s quarters.

Your script will call the function and prompt the user for their name.

Don’t forget to run your script with sudo otherwise you will receive an error. You may also use sudo within the script to prompt the user for the root password.

Extra credit: Use an if statement that asks the user if they want to add a printer to their computer. If the user responses yes, call the function captainPrinterYourName.

If the user responds no, exit out of the script

Complete Answer:

Get Instant Help in Homework Asap
Get Instant Help in Homework Asap
Calculate your paper price
Pages (550 words)
Approximate price: -
Open chat
1
Hello 👋
Thank you for choosing our assignment help service!
How can I help you?