Write a shell script that calculates information for content

Assignment Help Computer Engineering
Reference no: EM131458320

Assignment

Objective

To practice with shell scripting, and learn the basic skills to write shell scripts that perform simple tasks involving the monitoring of directories and files.

Task

A given UNIX directory may contain many files and subdirectories. For the purpose of this assignment, a "file" is a non-directory file, and a directory is a subdirectory of the given directory. Each file or directory might have different permissions. For example, a file might have read and execute permissions for the owner. A directory might have only read permission.

In this assignment, you will write a shell script that calculates the following information for the contents of a given directory. The directory that you will analyze will be passed in as a single command line argument to your script. You don't need to account for any contents of nested subdirectories -- just the direct contents of the specified directory passed in as a directory.

1. The total number of directories that are in directory passed as a parameter.
2. The total number of files in the given passed directory.
3. The number of items (files/directories) in the directory (passed as a parameter) that are readable.
4. The number of items (files/directories) in the directory (passed as a parameter) that are writable.
5. The number of items (files/directories) in the directory(passed as a parameter) that are executable.

Note that any hidden files or hidden directories are not included in this count. For example, ".."_ represents the parent directory of the current directory and is not counted as a directory or as a file. Similarly, ".login"_ would not be counted. Only regular files and directories in the given directory are calculated.

Requirements

• The script should be named assignment6.sh
• The script must be written to run under the bash shell!
• Your script must check for the correct number of arguments (one argument). If somebody tries to invoke the script without passing in the correct number of arguments, then output this usage message and abort the script:

Usage: assignment6.sh <directory_name>

• Your script must also check that the command line argument actually exists and is a valid directory (any directory). If it is not, then output an appropriate error message, and end the script processing. Example: If the user inputs a parameter that is not a directory you should issue the following message.

Reference no: EM131458320

Questions Cloud

Compute the implied average forward rate volatility : Given the market price of the caplet is $209,801.727, and using the following inputs for the caplet (notional $100 million, strike rate k = 4 percent, maturity.
Discuss how an enterprise might be attacked : Discuss how an enterprise might be attacked and the type of security device or mechanism you would select to combat the attack.
Opener with wales corporation imprinted : Jane gives a steel letter opener with Wales Corporation imprinted on it to a foreign government official as a gift.
Advise tom ltd of the australian income tax implications : LEGL602 TAXATION LAW ASSIGNMENT. Advise Tom Ltd of the Australian income tax implications of the above transactions
Write a shell script that calculates information for content : In this assignment, you will write a shell script that calculates the following information for the contents of a given directory.
Why are the actual and pseudo-probabilities different : Is the forward rate an unbiased estimate of the future spot rate of interest? Explain your answer.
Determine the competitors : Please share your thoughts on how Wendy's and Burger King's managers could utilize McDonalds financial information and ratios.
What is the value of the caplet : Suppose that the time 0 simple forward rate i(0,2) is 0.045 per year, the notional principal is LN is $40 million, the strike rate k is 0.04 per year.
Explain the growth process of managed care : Explain the growth process of managed care. How have Medicare and Medicaid played a role in this growth?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Improving the speed of e-mails

Insurance, a multi million-dollar life insurance firm, has asked you to help troubleshoot the network at its corporate headquarters.

  What is the minimum signal-tonoise ratio

What is the minimum signal-tonoise ratio (in dB) that the channel must have in order for it to be possible to achieve this data rate?

  As a software engineer what are the means of tracking you

as a software engineer what are the means of tracking you would use to track and monitor the reuse history of a

  Design the program in vb.net with a graphical user interface

Write down the program in VB.NET (not Web based) with a graphical user interface. Have the user input the amount in one currency and give him a choice to either specify a currency to convert to OR calculate results for all available currency conve..

  Assume one real-life example of each a multi-file volume

1. imagine one real-life example of each a multi-file volume and a multi-volume file. include a description of the

  The signal propagates 250 million meters per second along

two stations exchange packets of 100 bits using a link with 2800 bps transfer rate. the signal propagates 250 million

  Developing uml sequence diagram for uploading document

For the existing Blackboard system, a system utilized for virtual classroom, grades, messages, and announcements, develop ONE UML Sequence Diagram for uploading the document to Blackboard.

  Describe three different specific malware instances

Describe three different specific malware instances, with specific real life impact. What is the worst that can happen in these three instances? Defenses

  Find out for a well-known company

Review the code of ethics that you find for a well-known company. Based on research, analyze it to determine whether or not the company is complying with it.

  Risks of using wireless technologies in your department

A justification for the decision, and the risks of using wireless technologies in your department and A spreadsheet to track hardware or software requirements of your proposed wireless technologies, including the associated costs

  Write a java program that creates an array of integers

Write a java program that creates an array of integers

  What business to consumer and consumer to business items

Marketing and the owner of the CyberCafe would like to have items both in our shop and in Internet ecommerce site. What Business to Consumer and Consumer to Business items would your team recommend. What are the possibilities for fulfilment?

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