Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The final script is account_list.sh that is going to print a summary of some account information on your system. We've been looking at the /etc/passwd

image text in transcribed
The final script is account_list.sh that is going to print a summary of some account information on your system. We've been looking at the /etc/passwd file on and off. This script is going to parse that file to find and print the usernames for all non-system accounts. In addition, if the account has a non-standard (i.e., non-bash) shell, then the script will mark that username with an asterisk. In particular, when you look at a line of /etc/passwd, there are seven colon-delimited fields. The first is the username, the third is the user ID, and the seventh is the shell for that user. Your script must ignore all system accounts, which are accounts that have a user ID of less than 1000. If the account has an ID of at least 1000, then you will print the username of that account. If the shell for that account is not /bin/bash, then also print an asterisk after the name to indicate that it is non-standard. Of course, you may need to build in to the script to read from /etc/passwd with a while loop (You may not need a loop if you would like to learn awk more by yourself). Then you should be using awk to extract the appropriate fields from each line. while read line; do Here is a hint: # use awk here done

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Demystifying Databases A Hands On Guide For Database Management

Authors: Shiva Sukula

1st Edition

8170005345, 978-8170005346

More Books

Students also viewed these Databases questions

Question

How are members held accountable for serving in the assigned roles?

Answered: 1 week ago

Question

Have roles been defined and assigned?

Answered: 1 week ago