|I have these 3 scripts to write as a part of HW lab assignment. I really suck at this class, and its not part of my major but was required to take it.|
Anyway here they are
1) Restore the Exploring Word directory and then write a script to count the number of files in your Exploring Word directory that start with Chapter.
* Save the script as countFiles.cmd and upload it to the For Loop drop box.
2) Factorial is a mathematical procedure defined by the following formula:
n! = n (n-1) (n-2) …. (1)
4! = (4)(3)(2)(1) = 24
Write a script that will do the following:
* Allow the user to enter one positional parameter.
* Display an error message if the parameter is greater than 12. The shell can not handle n! for n greater than 12, due to the limitations of a 32-bit machine.
* If the number is 12 or less use a for loop to compute the value of n! where n is the number that was entered.
* Your script should display a message like: 3 factorial equals 6
* Name your script factorial.cmd.
3) Write a script that updates the renFor script to rename each file that starts with Chapter by changing the string Practice to Exercise within the file name.
* You will need to use a substring operation to isolate the file name from the path.
* Then you’ll need a substitution operation to replace the string Practice with Exercise.
* Save the script as renForSub.cmd