Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

UNIX/LINUX QUESTION. Solutions, only. Thanks! 1. Use the FOR loop to write a shell script that adds an extension .bak to all the files in

image text in transcribed

UNIX/LINUX QUESTION. 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 0 (2) chances to type the correct password before quitting -If the password doesn't 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 don't input any data, then display an error message to execute the script correctlv. 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 ie. sd 4. To reverse the number, use this expression 5. Decrease the input number (n) by 1 6. If n is greater than 0, then go to step no. 3. Else, execute the step no. 7 7. Print the result. Note: sd and rev are just variable names. However, you don't have to use these steps as you can come up to your own way of solving the problem. 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 0 (2) chances to type the correct password before quitting -If the password doesn't 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 don't input any data, then display an error message to execute the script correctlv. 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 ie. sd 4. To reverse the number, use this expression 5. Decrease the input number (n) by 1 6. If n is greater than 0, then go to step no. 3. Else, execute the step no. 7 7. Print the result. Note: sd and rev are just variable names. However, you don't have to use these steps as you can come up to your own way of solving the

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions