Question: ? ? ? ? Operating Systems Linux READ THE ENTIRE INSTRUCTON BEFORE SUBMITING YOUR WORK IN THE SLATE DROPBOX Description Write a Borne Again shell

???? Operating Systems Linux
READ THE ENTIRE INSTRUCTON BEFORE SUBMITING YOUR WORK IN THE SLATE DROPBOX
Description
Write a Borne Again shell (BASH) script which receives a path as the input and calculates the
number of each file type defined in Linux/Unix file types in the given path. Please review lecture
5 "File Structure and Processing" for different file type definitions. Name the script "filestatics".
Here are some sample runs of the "filestatics":
filestatics
You must enter a path:
Usage: filestatics pathname
filestatics foodir
foodir not found!
filestatics /dev /etc
You must enter a path:
Usage: filestatics pathname
filestatics /dev
Here is the /dev directory file type statistics:
OrdinaryBlockcharacterdirectorylinkpipesocket
5101361000
filestatics /etc
Here is the /etc directory file type statistics:
OrdinaryBlockcharacterdirectorylinkpipesocket
150320715
Note that the above numbers might be different in your machine.
Bonus
You will receive 2% bonus mark, if you also print the statistics for permission bits as well. Here
is a sample output:
filestatics/dev
General requirements:
Include the following header in your script:
#!/bin/bash
# Assignment 2
# Course:
# Family Name:
# Given Name:
# Student Number:
# Login name:
# Professor: Dr. Nick Sajadi
Always check if the script has received the correct number of parameters and their orders
based on the shown examples. If the user enters wrong parameter print an error message
and notify the right usage format. In case of usage error or any other unusual error you
need to exit with none zero value.
The output of your script should be nicely formatted. Use the tab character to properly
format the output of your script.
If you create intermediate temporary files anywhere including in / tmp, remove them
before your script ends.
Make sure, you have had enough comments to make your script readable and
understandable.
If you have solved the bonus part, clearly mention both in scripts and in Slate as a
comment. If you miss one of them, you won't receive bonus marks.
IF YOUR SCRIPT HAS RUNTIME ERROR, YOU GET ZERO FOR THIS
ASSIGNMENT
IF YOU USE ANY COMMAND OR CONCEPT OTHER THAN COVERED IN
LECTURES, SUCH AS "awk", YOU WILL GET ZERO FOR THIS
ASSIGNMENT.
? ? ? ? Operating Systems Linux READ THE ENTIRE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!