Question

___________________ Create a shell script program that has displays the following menu on a page: This...

___________________ Create a shell script program that has displays the following menu on a page: This is a Linux Question, and the script is written in Vi test, and run in Putty.

Press 1 to enter new order.

Press 2 to access order status.

Press 3 to cancel order.

Paste a screenshot shot of the code below

Paste a screenshot of the code output below (2 point):

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is a code for above menu print...

main.sh

clear

  echo "----------------------"

  echo " M E N U "

  echo "----------------------"

  echo "Press 1 to enter new order."

  echo "Press 2 to access order status."

  echo "Press 3 to cancel order."


local choice

  read -p "Enter choice [ 1 - 3] " choice

  case $choice in

    1) echo "You chose to enter new order"

;;

    2) echo "You chose to access order status"

;;

    3) echo "You chose to cancel the order..."

;;

    *) echo -e "${RED}Error...${STD}" && sleep 2

  esac

Screenshots:

when input is => option 1:

when input is => option 3 :

when input is => invaid:

Some commands for Vi Editor:

1> vi filename

ex: vi main.sh

2> To edit the file

press ESC and "I" keyboard key

3> to save and quit:

press ESC and ":wq" keyboard keys.

4> After saving above code in main.sh

run "./main.sh" command to see the output.

NOTE: if permission is denied to access that file then you have to modify the permission using "chmod" command.

e.g. chmod +x main.sh [enter]

./main.sh [enter]

Add a comment
Know the answer?
Add Answer to:
___________________ Create a shell script program that has displays the following menu on a page: This...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create any Linux (Ubuntu, Debian, Kali etc) Virtual Machine on your computer. A shell script is...

    Create any Linux (Ubuntu, Debian, Kali etc) Virtual Machine on your computer. A shell script is a sequence of shell commands written in an executable script file. Executing this file instructs the shell to execute all commands in the order of their appearance in the script file. There is several shell scripting tutorials available on the web, e.g. search by entering the keywords Linux shell script tutorials. Go through one of these tutorials and then write a shell script that...

  • BCS 215 (Unix Operating Systems) Create a bash shell script that displays a coffee vending machine...

    BCS 215 (Unix Operating Systems) Create a bash shell script that displays a coffee vending machine menu and asks the user to make a choice - 1. Print "Please enter your choice: decaf|regular|latte|cappuccino" 2. Depending on the user input, print out the related price - decaf: 2 dollars regular: 2 dollars latte: 3 dollars cappuccino: 3 dollars For anything else, please display "Please make a valid choice." 3. Upon a successful execution of the script, display "Thank you for using...

  • Project overview: Create a java graphics program that displays an order menu and bill from a...

    Project overview: Create a java graphics program that displays an order menu and bill from a Sandwich shop, or any other establishment you prefer. In this program the design is left up to the programmer however good object oriented design is required. Below are two images that should be used to assist in development of your program. Items are selected on the Order Calculator and the Message window that displays the Subtotal, Tax and Total is displayed when the Calculate...

  • PYTHON Programming Exercise 2: Create a Simple Cost Calculator Write a program that displays input fields...

    PYTHON Programming Exercise 2: Create a Simple Cost Calculator Write a program that displays input fields (item name and cost) and calculates and displays the calculated costs. The program should do the following: Provide data entry areas for item name and cost. Calculate and display the subtotal of all items. Adds a sales tax of 6% and calculate and displays the total cost. Enter the following values into your program. Mother Board $200. RAM $75. Hard Drive $72. Video Graphics...

  • Write a Python Program that displays repeatedly a menu as shown in the sample run below....

    Write a Python Program that displays repeatedly a menu as shown in the sample run below. The user will enter 1, 2, 3, 4 or 5 for choosing addition, substation, multiplication, division or exit respectively. Then the user will be asked to enter the two numbers and the result for the operation selected will be displayed. After an operation is finished and output is displayed the menu is redisplayed, you may choose another operation or enter 5 to exit the...

  • (In Linux) 1. Create a file to write to from your script and save it as...

    (In Linux) 1. Create a file to write to from your script and save it as “.txt”. 2. Write the following information to the file that you created in Step 1: Today's date Your full name Your student ID The name of your course What directory you are in File permissions of the file that you created that allow everyone to read, write, and execute The long list of files in your current directory, providing all items and their process...

  • Create a menu-driven program (using the switch) that finds and displays areas of 3 different objects....

    Create a menu-driven program (using the switch) that finds and displays areas of 3 different objects. The menu should have the following 4 choices: 1 -- rectangle 2 -- circle 3 -- triangle 4 -- quit If the user selects choice 1, the program should find the area of a rectangle. rectangle area = length * width If the user selects choice 2, the program should find the area of a circle. circle area = PI * radius * radius...

  • Design program so that it correctly meets the program specifications given below.   Specifications: Create a menu-driven...

    Design program so that it correctly meets the program specifications given below.   Specifications: Create a menu-driven program that finds and displays areas of 3 different objects. The menu should have the following 4 choices: 1 -- square 2 -- circle 3 -- right triangle 4 -- quit If the user selects choice 1, the program should find the area of a square. If the user selects choice 2, the program should find the area of a circle. If the user...

  • The first script is validate.sh. This is a simple form validation script that will be used...

    The first script is validate.sh. This is a simple form validation script that will be used to verify the inputs given. Normally, this would be done to validate input from a website or another program before entry into a database or other record storage. In this case, we will keep it simple and only focus on the input validation step. In particular, the script should prompt the user for four values: first name, last name, zip code, and email address....

  • JavaScript expert, I need your help : My program doesn't work. I have the following program,...

    JavaScript expert, I need your help : My program doesn't work. I have the following program, it is simple web page: Create an object called person with name = John, age = 50. Then, access the object to display "John is 50 years old”. I have written some code here. Hint: Create an object with the var keyword, followed by a name and an "=" sign. Put the properties and values inside the {}; signs Note: Use getElementById() and innerHTML...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT