Ask a question to Desklib · AI bot


Bash program to manage customer files

3 Pages554 Words253 Views

Added on  2019-09-16

About This Document

This bash program manages customer files with create, payment and find actions. Each customer has a separate file with identification and account records. The program interacts with the user through a menu and performs the corresponding action based on user input. The program also handles errors and displays appropriate messages. The initial customer files are provided in a Data directory. The program consists of four bash files: proj1.bash, create.bash, payment.bash and find.bash.
BookmarkShareRelated Documents
Project #1 - bashUsing bash (not a higher level language), construct a program which manages customer files. Each customer has a separate file. Your program will interactively manage customer accounts.Customer File ContentOne file per customer, named the customer's email addressEach customer file contains two records:1.Identification record which has two attributes:Customer EmailCustomer Full Name2.Account record which has four attributes:Apartment Number - format (APT-xx)Monthly Rent AmtAccount BalanceNext Due DateExample customer file Bill BoardAPT-5A 1100.00 0.00 2017-10-01Action MenuDisplay a menu which showsEnter one of the following actions or press CTRL-D to exit.C - create a customer fileP - accept a customer paymentF - find customer by apartment numberRead a one character action. Based on the action, do the following:C - CREATE - create a customer fileFrom the terminal, read (each from separate read requests)oCustomer EmailoCustomer Full NameoApartment NumberoMonthly Rent AmtoNext Due DateDefault the Account Balance to zeroCreate a new customer file using the customer's email as the file name. If the file already exists, show an error message (and do nothing).Assume that each of the five attributes should be read before checking for prior existence.P - PAYMENT - accept customer paymentFrom the terminal, read oCustomer EmailoPayment AmountUpdate the customer's file, adding the payment amount to the Account Balance
Bash program to manage customer files_1

Found this document preview useful?