Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this exercise, it must be done in bash. Control structures, loops, and sequential operations are required elements for programming languages. A

I need help with this exercise, it must be done in bash.image text in transcribed

Control structures, loops, and sequential operations are required elements for programming languages. A high- level programming language will implement control structures, loops, and sequential operations in a machine- independent manner. These mechanisms allow programs to branch out to different parts depending on a logical decisions. Remember that binary operations like shell commands output return values of true or false. Instructions One common feature of high-level programming languages is the ability to create a menu system. In this assignment you will develop a menu-based shell script which will run UNIX commands. Please look at the command_menu program on page 456 (or page 444 in the third edition of the textbook). Your job will be to implement similar program with a total of 10 commands, plus the "'" catch all case. This program will have a menu with 10 commands from the menu below . wmorales@syccuxfs01:> bash menu_script.sh Command Menu a. Emailer Program b. Display Users Currently Logged On c. Display Current Date and Time d. Display This months Calendar e. Display name of the Working Directory f. Display Contents of the Working Directory g. Find the IP of a Web Address h. See your Fortune i. Display a file on the screen j. Exit Please select a letter: Here is a sample interaction with the emailer portion of the program. There is no need to display the calendar or show a list of available files to attach. Please select a letter: a (this would go to the option for the emailer program that you . created) This program will allow you to send a message, with a file attachment, to any selected user. Please enter the subject of your message and press : Test message Please enter the email address of the recipient and hit :wmorales@pcc.edu Please enter the file to be attached to this message and press please choose a file: testhle Then it would got back to the main menu . .Comment your program, A comment block such as those on the examples seen in the lecture must be on top of your script file with your name, date, description of the program. Make sure to document your program with comments in the various areas of your program. Ask questions if you are in doubt about what need to be accomplished and use the discussion board. .After testing your menu program and verifying that it worked correctly, put your program inside of a loop (e.g., using until or while). Consequently after each option is concluded your program will go back to the main menu until the user selects an option to exit. For full points use a structured logic approach to exit the program. Try NOT TO USE THE EXIT command to quit the script. Also using infinite loop such as while: or while true or until true, etc. is NOT good programming. .Your first option will be an emailer program, and the user needs to input the subject, _recipient name, and file which represents the body of the e-mail which you'll redirect as input. This emailer program will be automated using mail: mail -s".The whole program should be in one file; do not call different scripts (/emailer.sh for instance)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Logistics Lifeline Supply Chain Strategies

Authors: Ehsan Sheroy

1st Edition

7419377502, 978-7419377503

More Books

Students also viewed these Databases questions

Question

Understanding Groups

Answered: 1 week ago