Question: Using your favorite Linux text editor, gedit , vi , ed , or nano , create a user management shell script using a while logic

Using your favorite Linux text editor,gedit,vi,ed, ornano, create a user management shell script using awhilelogic calledUserName_Final2. You must replaceYourWakeTechUserNamewith your actual Wake Tech username for the script's name.
Important Notes:
Follow the directions (do and do not) for each step to write the script.
The script's output after the execution must look like the sample run on this page.
Attach (a) screenshot(s) of your script after debugging it in the box provided.
Do not use a function in this script.
Do not use if and else or case statements in this script.
Direction:
Step 1. Use a correct hashpling line. (2 points)
Step 2. Use your full name as a comment in the script. (2 points)
Step 3. Use a while loop that keeps looping until the user enters any character other than y. Do not use an infinite loop or while true. You must use a variable for the loop (10 points)
Step 4. Display "Enter a new username: " on your terminal (make sure the cursor stays on the same line as the prompt: (4 points)
Step 5. Use a command to read users' keyboard input for a new username. (4 points)
Step 6. Use useradd to create a new user account based on the user's input with the following specifications: (16 points)
For username, use the user's input keystroke.
For the default shell, make /bin/sh as the new user's default shell.
Use an option to ensure the creation of a user's home directory.
Use an option to create a private sudo user's group (Alma Linux "admin" and Ubuntu "administrator") as a secondary group for new users.
Step 7. Use a combination of grep and regular expression to list only the corresponding line for the new username. (5 points)
Step 8. Use theidcommand to list the user ID, group IDs, and primary and secondary groups for the new user. (5 points)
Step 9. Display "Would you like to continue? Enter y to continue: " on your terminal (make sure the cursor stays on the same line as the prompt: (4 points)
Step 10. Use a command to read users' keyboard input for y to continue or other characters to quit the while loop. (4 points)
Using your favorite Linux text editor, gedit , vi

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!