Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3 . 3 . ( Script 3 ) You are supposed to write a shell script that will count the number of files stored in

3.3.(Script 3) You are supposed to write a shell script that will count the number of files stored in the directory given as the script execution parameter. For test purposes, a test environment has been prepared in the script check system with some files. You must use loop instruction. Your script will be executed in the command line as:
scriptname dir_name
Suppose youve got the following directory structure:
A-
-a.txt (size 5 bytes)
-b.txt (size 7 bytes)
-c.txt (size 1 byte)
-d.txt (size 4 bytes)
For the example execution:
scriptname ./A
your script should return 4.
The only thing your script is expected to return is a number reflecting the total number of files in the given directory. Neither, runtime messages nor error messages should appear on the screen (you may need to re-direct the standard error stream for operations that might be a source of any kind of error as command 2>/dev/null).
Your solution will be marked concerning the correctness of the file counting operation.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

Students also viewed these Databases questions

Question

6. How do histories influence the process of identity formation?

Answered: 1 week ago

Question

=+3 In what ways can an MNE improve or change its approach to IHRM?

Answered: 1 week ago