Unix programming

Assignment Help Programming Languages
Reference no: EM13820446

Instructions

 

This project incorporates many skills learned throughout this course. Prepare the shell program described below using a modular approach that uses functions where appropriate.

First, identify the password file attached to this project, the one used in assignment 5, or create your own as desired. It will be used in this project. Make sure it at least has your own "logname" username of yourself in the file.

Second, create an office telephone directory file containing three columns of the last name, first name, and phone number of at least 10 individuals. Then create a shell program that accepts either one (last name) or two (last name and first name) arguments. Check to ensure that one or two arguments are on the command line. If there is only one argument, display a message informing the user that more than one entry might be returned from the phone book. Exit the program if there are less than one or more than two arguments.

Third, after checking on the arguments, display a prompt asking what phone book directory file to search. Test to ensure that the entry is a valid regular file that is not zero bytes in length. If not a regular file, exit the program with an appropriate message to the user on the screen. Then check to see that there are three columns in the file. If there are not three columns, display a message indicating that the file does not contain a configuration consistent with a phone book and exit the program with an appropriate message displayed on the screen.

Fourth, display a menu in the shell program that allows adding (A) an entry to the phone book, deleting (D) an entry from the phone book, modifying (M) an entry in the phone book, displaying (I) an entry in the phone book, displaying (P) all entries in the phone book in sorted order, or exiting (X) the program. Accept either an uppercase or lowercase letter for the menu option. For adding, deleting, or modifying an entry, add additional code that checks the "logname" of the user running the shell program and ensures that the user is a member of the class (in the /etc/passwd personally created password file). For security reasons, you may need to use the passwd file included as an attachment in the assignment or use your own. This program continues until the exit choice is entered.

Other General Requirements:

In addition to including the above-mentioned functionality, make sure you incorporate each of the following elements in order to receive full credit:

1. Inclusion of a trap statement at the top of the program and testing to ensure that it works.

2. Completely functional business logic for each of the menu options (i.e., adding, deleting, modifying, displaying).

3. Use of functions throughout- such as for each menu option

4. Use of Linux commands: sed and conditional statements (e.g, if and do or while)

5. Upload of both the actual shell program code and three or more screenshots illustrating the functionality of the menu options

Reference no: EM13820446

Questions Cloud

What a developmentally appropriate environment would include : Describe what a developmentally appropriate environment would include. Explain the significance of designing an environmental space to nurture a child's physical, socio-emotional, cognitive, and language development.
Wanna farming autobot for a mobile game : Wanna Farming Autobot for a mobile game
Grade book program : Grade Book Program
Project manager managing projects : Identify two key challenges project managers must address in public sector infrastructure projects and discuss how these challenges are similar to and different from those experienced by a project manager managing projects within a corporate envir..
Unix programming : UNIX Programming
Supply of cashews and the price of cashews : In the long run, what will happen to the supply of cashews and the price of cashews?
Create a class named date that stores date values : Create a class named Date that stores date values
Calculate the mass fraction of sulfuric acid : Two aqueous sulfuric acid solutions containing 20.0 wt% H2SO4 (SG = 1.139) and 60.0 wt% H2SO4 (SG = 1.498) are mixed to form a 4.00 molar solution (SG = 1.213). Calculate the mass fraction of sulfuric acid in the product solution.
Find the probability of the number of women : A random sample of 13 adult women is selected. Use the binomial probabilities table or technology to find the probability of the number of women in this sample of 13 who had tried 5 or more diets in their lifetime is

Reviews

Write a Review

Programming Languages Questions & Answers

  London underground fire at the kings cross underground

london underground fire at the kings cross underground station on 18 november 1987 a wooden escalator caught fire

  Creating website-based sales system for retail firm

Assume that you have been hired to create website-based sales system for large international retail sales firm.

  Write a prolog program that finds the last item in a list

Write a Prolog program that finds the last item in a list. Include a test query.

  Basics of hypertext markup language

The basics of Hypertext Markup Language and World Wide Web.

  Write program which reads three integer from input dialogs

Write down the program which reads three integer. Integers are entered from input dialogs and stored in variable num1, num2, and num3, respectively.

  Advantages of turning the atm switches into lsr

Under these conditions, what are the advantages, if any, of turning the ATMswitches into LSRs, as opposed to using an overlay network?

  Interactive program that plays the game hangman

Write an interactive program that plays the game Hangman. Use the random integer function to randomly select the word to guess out of the file provided. The player must guess the letters belonging to the word.

  Why wont the following program compile correct it so it

question why wont the following program compile?class exception3 public static void mainstring args if

  Draw a state transition diagram for garage door system

Draw a state transition diagram for garage door system - Design a PLC program using ladder logic that has two input and three outputs.

  Wilkerson-irwin algorithm to minimize mean tardiness

Write a program to implement the Wilkerson-Irwin algorithm to minimize mean tardiness.

  Assume you have bought an old semi-furnished house and need

assume you have bought an old semi-furnished house and need to renovate it before moving in. generally renovation work

  Design and implement program that creates exception class

Design and implement a program that creates an exception class called StringTooLongException, designed to be thrown when a string is discovered that has too many characters in it

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd