Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

This is an individual assignment. There are three (3) shell programming tasks in this assignment.

You are required to make a directory named kit501agn2 under your home directory (on alacritas), and use kit501agn2 as your working directory for this assignment. Your assignment will be marked on alacritas, one of our School's UNIX servers.

Task A

Write a shell script (to run on the Bourne shell) that can be used to remove some old C programs you no longer wish to keep. When the script is run with no arguments supplied, it picks up each C program from the current directory and lists the first 10 lines (hint: research the head command). It then prompts for deletion of the file (the user can then choose to delete or not to delete the file). When the user supplies arguments (C program file names) with the script, it works on those files only.

Your script for this task must be named delC.sh. In designing your script you should consider the following scenarios:

- There is no C program file stored under the current directory;
- There is at least one C program file stored under the current directory;
- The user-supplied arguments list contains names of existing C programs stored under the current directory. We can assume that all the C programs have been correctly named as *.c, and that there is no special character (such as space) in any of these filenames;
- The user-supplied arguments list contains both existing and missing names of C programs stored under the current directory. Missing names refer to the files which no longer exist under the current directory.

Make sure your script is user-friendly and follows common sense (for example, when there is no C program stored under the current directory your script should display a message and then exit). The following is a sample output of the script. The $ is the shell prompt.

Task B

Write a shell script (to run on the Bourne shell) that runs an infinite loop to monitor the creation and removal of .pdf or .PDF files under the current directory. Every 3 seconds it should display a list of those filenames created or removed after the previous display. Without loss of practical significance of this utility, we can assume that the time interval between creation of a .PDF or .pdf file and removal of a .PDF or .pdf file is over 3 seconds, which means that it's unnecessary for your script to handle the situation where creation of a file is followed by immediate removal of a file. (Hint: research the cmp and comm commands.)

Your script for this task must be named pdf.sh. The following is a sample output of the script (It is OK that the script leaves behind a temporary file when it is finally interrupted). The $ is the shell prompt.

Task C

Write a shell script (to run on the Bourne shell) that allows a user to view or delete a setting in a configuration file (config.txt) that contains settings in the form variable=value. The following is an example of such configuration file:

For All Your Scripts
You must
- Include your name, student ID, and a brief introduction of what the script does in all your shell scripts, as a comment in the beginning of each script.
- Make your scripts run on the Bourne shell, regardless of which shell the user of your scripts is currently on.
- Add in-line comments to help other people understand your scripts.
- Use "\n" where appropriate to make the output of your scripts more readable.
- Note that your script structure and layout are also important as they will be marked as part of the assessment process.

Attachment:- A2.rar

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91976390

Have any Question?


Related Questions in Computer Engineering

Question is it ethical for a potential employer to use the

Question: Is it ethical for a potential employer to use the Internet this way? Is it legal? What if an angry ex-boyfriend or ex-girlfriend posted some things, pretending to be you? How might this affect your chances for ...

Help me define corporate social responsibilityhelp me

Help me define corporate social responsibility. Help me conduct research on a Fortune 500 company and how do you determine just how (or if) the company ranks from a CSR perspective. Help me understand if the findings cha ...

Briefly explain what separations are how do they effect the

Briefly explain what separations are, how do they effect the average duration of unemployment?

Suppose a 4 packets of a message each of size 10 mbit

Suppose a 4 packets of a message, each of size 10 Mbit arrive simultaneously at a switch preceding a transmission link of rate 5 Mbps connecting to the destination host. (a) What is the average queuing delay experienced ...

Scenario your algorithm will keep track of a customers

Scenario Your algorithm will keep track of a customer's purchases at the local fireworks stand. Customers will not know exactly how many items they will purchase, so using a For loop on this lab is not allowed. Let's kee ...

Cwrite function that takes an array of doubles and the

C++ Write function that takes an array of doubles and the array length as parameters (compute the array length using size of, don't just put in the number 5). In the function, find and return the largest value. Write sec ...

In a nationwide poll of 1500 randomly selected us residents

In a nationwide poll of 1500 randomly selected U.S. residents, 77% said they liked pizza. In a poll of 1500 randomly selected U.S residents one month later, 75% responded they liked pizza. a. Does the polling evidence su ...

Discuss the importance of using an access control model in

Discuss the importance of using an access control model in determining how employees in an organization should gain access to resources.

A medical researcher is interested in determining whether a

A medical researcher is interested in determining whether a new medication for lung cancer is effective in a group of patients with early-stage disease. Explain what a Type I and Type II error would be in this study. (Be ...

Research the web for an example of a startup using a cloud

Research the Web for an example of a startup using a cloud infrastructure. What were the main reasons for choosing a cloud infrastructure? What alternatives did the startup have? Answer should be at least 1 page long dou ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As