Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help with code and where do i define the path There is a bit leas hand-holding in this lab than in the previous lab.

please help with code and where do i define the path

image text in transcribed

image text in transcribed

image text in transcribed

There is a bit leas hand-holding in this lab than in the previous lab. Refer back to the Lab 1 writeup if you have forgotten anything important Requirements Your acript ahall be named srpt and be marked executable. Here is how you execute your acript: /srpt PATH Example /srpt./testfolder Your script ahall inspect the file names of avery fle and directory in the folder reprecented by PATH and accumulate a count of each of the following file syatem objecta Every file Every subdirectory (excluding "PATH" itself) Every symbolic link Every file that is 365 days old or older (old files) Every file that is larger than 500,000 bytes (large files) Every graphics file (any file with suffix of .jpg, gif or bmp) Every temporary file (any file with a suffix of "o") Every executable file (any file executable by the user) Total byte count of each file . Your srpt script shall produce a report in this format in thia order inote the exact spelling of the labela, the apacing and the commaa in the numbera): SearchReport host path date Execution time nnn Directories n,nnn,nnn Files n,nnn, nnrn Sym links n,nnn,nnn Old files n,nnn,nnn Large filesn,nnn,nnn Graphics files n,nnn,nnn Temporary files n,nnn, nnn Executable files n,nnn,nnn TotalFileSize n,nnn,nnn Your srpt script should exit with return code 0 (zero) after producing its report unless the path was not specified on the commandline. If your script is executed without a PATH, issue this usage statement and exit with return code 1 Usage: srpt PATH Additional Requirements You are free to use whatever tools that are available in order to produce the requested output. Please note the e You may only make one pass over the files per execution of your script (meaning no multiple file system searches). The find command is the best utility to obtains all of the required information in a single execution of find. Search the Internet for examples on how to use find to search and count files of a given name or type and save that information in a temporary file. You may not modify any file or directory in the requested path. If you create any temporary files, do so only in a unique folder you create, in tmpI recommend creating a folder in /tmp with your icarus userlD IN YOUR SCRIPT so that its name is unique. e SearchReport host path date Execution time nnn Directories n,nnn,nnn Files n,nnn, nnrn Sym links n,nnn,nnn Old files n,nnn,nnn Large filesn,nnn,nnn Graphics files n,nnn,nnn Temporary files n,nnn, nnn Executable files n,nnn,nnn TotalFileSize n,nnn,nnn Your srpt script should exit with return code 0 (zero) after producing its report unless the path was not specified on the commandline. If your script is executed without a PATH, issue this usage statement and exit with return code 1 Usage: srpt PATH Additional Requirements You are free to use whatever tools that are available in order to produce the requested output. Please note the e You may only make one pass over the files per execution of your script (meaning no multiple file system searches). The find command is the best utility to obtains all of the required information in a single execution of find. Search the Internet for examples on how to use find to search and count files of a given name or type and save that information in a temporary file. You may not modify any file or directory in the requested path. If you create any temporary files, do so only in a unique folder you create, in tmpI recommend creating a folder in /tmp with your icarus userlD IN YOUR SCRIPT so that its name is unique. e

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

Step: 3

blur-text-image

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

Rules In Database Systems Third International Workshop Rids 97 Sk Vde Sweden June 26 28 1997 Proceedings Lncs 1312

Authors: Andreas Geppert ,Mikael Berndtsson

1997th Edition

3540635165, 978-3540635161

Students also viewed these Databases questions