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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started