Question
UNIX/LINUX QUESTION. Please, Solutions Only. Thanks! 1. Use the FOR loop to write a shell script that adds an extension .bak to all the files
UNIX/LINUX QUESTION. Please, Solutions Only. Thanks!
1. Use the FOR loop to write a shell script that adds an extension .bak to all the files in a directory by changing all the files in a directory to a .bak extension. Kindly make sure to supply the directory name as an argument while running the test script.
2. Use any loop technique to rewrite your shell script to validate password strength. Your program should prompt user for a password based on the following requirements:
-Length should be a minimum of 8 characters.
-Contain both alphabet and number.
-Include both the small and capital case letters.
-If the password entered is not valid, the program should give the user another two (2) chances to type the correct password before quitting.
-If the password doesnt comply to any of the above conditions, then the script should report it as a Weak Password otherwise display a Strong Password
3. Write a shell script to print a number in reverse order. It should support the following requirements. The script should accept the input from the command line. If you dont input any data, then display an error message to execute the script correctly.
Possible steps involved in the test script. 1. Suppose the input number is n. 2. Set reverse and single digit to 0 (i.e. rev=0, sd=0). 3. The expression (n % 10) will give the single left most digit i.e. sd. 4. To reverse the number, use this expression
Note: sd and rev are just variable names. However, you dont have to use these steps as you can come up to your own way of solving the problem.
4. For given numbers 1 to 10, display any number that is less than 5 and stop the loop.
5. For given numbers 1 to 10, display only odd numbers: 1,3,5,7,9.
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