Question: Write a shell script program that contains a function calledfindFiles(). This function can list all files of a particular type in the current directory and
Write a shell script program that contains a function calledfindFiles(). This function can list all files of a particular type in the current directory and then copy them to a new director called MyFiles.The file type (such as shell script files with a appendix .sh ) will be passed as a parameter when the function is called. You program also needs a function call to thefindFiles() function to test it. For example:
findFilessh
Note: sh is the parameter to be passed intofindFiles(). Then the output of your program should be all shell script files with the appendix .sh and all of these files will be copied into a new directory calledMyFiles.
Hints: you can use built-inlinuxcommands in your shell scripts such as ls, mkdir...
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
