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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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