Question: Task 2.6 : In this exercise, you will create a script to echo users, based on a list of usernames in a file. 1. create
Task 2.6 : In this exercise, you will create a script to echo users, based on a list of usernames in a file.
1. create a new file called userlist.
#vi userlist
2. Insert a short list of usernames, such as the following. Make sure that none are the names of existing users.
moe
larry
curly
binny
3. create a script file userscript.sh and type the following lines
#!/bin/bash for TheUSER in $(cat userlist) do
echo The user is $TheUSER done
4. Add the permissions and run the script
show all input and output, as well as screen shots for every step taken. I am running the code on my terminal
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
