Shell script- remove old programs you no longer wish to keep

Assignment Help Computer Engineering
Reference no: EM131220447

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

Reference no: EM131220447

Questions Cloud

Find the transfer function of the filter : Find the transfer function of the filter. - Find the impulse response of the filter. For both parts, make sure your answer results in a causal filter.
What was the net income and what were the total expenses : What was the total amount of withdrawals for the year? What was the net income? What was the total revenue? What were the total expenses?
Compute the net benefits using the discount rate : Consider the following two projects. Both have costs of $5000 in year1. projects 1 provides benefits of $2000 in each of the first four years only. The second provides benefits of $2000 for each of years 6 to 10 only. Compute the net benefits usin..
Assume that the expropriation is extraordinary : On January 1, 2014, Lennon Industries had stock outstanding as follows. 6% Cumulative preferred stock, $108 par value, issued and outstanding 11,900 shares $1,285,200 Common stock, $11 par value, issued and outstanding 282,000 shares 3,102,000 To acq..
Shell script- remove old programs you no longer wish to keep : Assignment Two - UNIX Shell Programming - KIT501 System Administration Fundamentals - 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..
Determine the ratio of the noise equivalent bandwidth : A filter has the following transfer function: - Determine the ratio of the noise equivalent bandwidth for this filter to its 3-dB bandwidth.
Cartel might make this offer : Many retail stores offer to match or beat the price offered by the rival store. Explain why firms that belong to a cartel might make this offer?
What is the bandwidth of the filter : What is the bandwidth (3 dB) of the filter? - What is the attenuation (or gain) at zero frequency? - Show one possible filter that could have produced this output PSD.
Waiting list exists for right to purchase season tickets : Philadelphia Flyers games are frequently sold out, and a waiting list exists for the right to purchase season tickets. What would be the welfare effects of a $1 tax on tickets? Explain

Reviews

Write a Review

Computer Engineering Questions & Answers

  By using the traditional join method write down a query by

using the traditional join method write a query using the orderitems and book tables to list the order number book

  Write down the names of five currencies

Write down a C program that displays a title, "Currency Conversion," and then write the names of five currencies and their equivalents to the US dollar. The conversions are hard coded equations.

  Questionexamine the key components of a decision support

questionexamine the key components of a decision support system and issues facing an implementation of dss. what

  Produce a class diagram for denbys video hire system

casedenbys video hire are a chain of 10 stores in the coventry amp warwickshire area. they provide a dvd movies hire

  B typed double spaced using times new roman font with

please dont use personal pronunce resources include names date subject and web link write a three to four page paper in

  Write down a function called numweeks

Write down a function called numWeeks that takes an integer parameter representing a number of days and returns an integer that is the number of whole weeks in that number of days.

  How each diagram relates to the solution

Your submission should include 6 to 8 pages of Visio developed UML diagrams (minimum of six different ones), hierarchy chart, and flowcharts; copy/paste into a MS Word document that also contains the pseudo code and data dictionary for the solutio..

  Discuss the steps that should be tried when experiencing a

1. discuss the steps that should be tried when experiencing a network connection problem2. explain what a broadcast

  What is the largest value of x

A soft real-time system has four periodic events with periods of 50, 100, 200 and 250 msec each. assume four events require 35, 20, 10 and X msec of CPU time, respectively. What is the largest value of X for which the system is schedulable.

  Questionhow can government justify telling private industry

questionhow can government justify telling private industry how to set up or recover their cybersecurity?1. clearly

  Determining the bandwidth

Suppose N ethernet stations, all trying to transmit at the same time, need N/2 slot time in order to sort out who transmit next. Supposing the average packet size is 5 slot times, express the available bandwidth as a function of N?

  How to write and run a java program

how to Write and run a Java program that, given a distance in metres, outputs that distance in kilometres rounded to the nearest whole kilometre.

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