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 all semester. 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'll need to build in to the script to read from/etc/passwd with a while loop as we've seen before. Then you should be using to extract the appropriate fields from each line. Here is a sample run: Once you've got it tested and working, TAKE SCREENSHOT 4 of the output of the script for a sample run. Only provide a single screenshot. More than one will be ignored. PLACE SCREENSHOT 4 HERE: COPY AND PASTE your script into this box for formatting (also note that if you submit in a separate file, you MUST include the start and end script lines below)

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

Databases Illuminated

Authors: Catherine M Ricardo, Susan D Urban

3rd Edition

1284056945, 9781284056945

More Books

Students also viewed these Databases questions

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago