Create new user account - system administrator, Computer Engineering

Assignment Help:

A common task for a system administrator is to create new user accounts. In this lab you will be creating output that looks like an /etc/passwd file.

The Problem

You are to write a Perl script that will read in values from an INPUT file to be passed as an argument to the script.  The file contains the following information:

  • The user's full name (e.g.,  Mike H Smith)
    • A period after Middle name is optional
    • Full Middle name is also optional
    • Assume there is always one space between First, Middle, and Last name
    • You do NOT have to perform error checking on this field
  • The user's ID number (ssno)
    • Should be of the form: 3 digits, dash, 2 digits, dash, 4 digits

Ex: "111-22-3333"

    • You DO have to perform error check on this field using string functions mentioned in class. If the full social security number (the part between "/") is not of the right format you MUST print out the following message to STDERR: The String "Bad Soc" followed by a colon, then a space and the offending invalid Soc number. For Example:

Bad Soc: 123-456-7888

    • Your error message must look EXACTLY like this, do not vary even slightly!
    • You ONLY have to make sure that the dashes are in the correct places and the number of characters is correct NOT that the other characters are actually digits
    • (DO NOT USE split() and REGULAR EXPRESSIONS for this)
  • The user's group (will be "student", "staff" ONLY)
    • You do NOT need to perform error checking on this field

Based on this information, you will print to STDOUT a user line analogous to the one that would appear in /etc/passwd.

The INPUT file will be formatted as follows:

First Middle Last/SSN/Group

With the "/" character being used as the delimiter.

For example:

John X. Doe/555-12-1234/staff

Mike Xavier Smith/123-45-1111/student

Susan Q Jones/109-54-8832/student

Emily Sophie Zielewsky/987-65-4322/staff

Once you have the necessary input from the file, you need to create the following fields to display to STDOUT:

username:passwd:uid:gid:full name:home dir path:shell


o   Create a old DCE style username for students: first initial, middle initial, last initial followed by last 4 of SSN (abc1234).

o   Use just the 3 initials of the name for the username for staff (yxn)

o   Note that there are NO uppercase letters in usernames


In the modern age of password shadowing you would never really do this, but for the purpose of this lab you should allow the user to enter input for this value.

Related Discussions:- Create new user account - system administrator

E brokerage facilitates search & retrieval of information, E Brokerage faci...

E Brokerage facilitates search & retrieval of Information The success factor of a brokerage is its ability to retain existing clients and to enhance their satisfaction by effec

Determine the importance of computer hardware, Determine the importance of ...

Determine the importance of computer Hardware Hardware forms the greatest asset of the company, but it reaches obsolescence very quickly. Normally, it is said that every six mo

Origin of RISC, Q. Origin of RISC? In the 1980s a new philosophy develo...

Q. Origin of RISC? In the 1980s a new philosophy developed having optimizing compilers which could be used to compile 'normal' programming languages down to instructions which

Define congestion and grade of service, Define congestion and grade of serv...

Define congestion and grade of service. Congestion : This is uneconomic to give sufficient equipment to carry all the traffic which could possibly be offered to a telec

What is reification and behaviour, What is reification and behaviour? R...

What is reification and behaviour? Reification is the promotion of something that is not an object into an object. Behavior usually requires this description. It isn't usually

What is telnet explain, Q. What is Telnet explain? TELNET stands for TE...

Q. What is Telnet explain? TELNET stands for TErminal NETwork. Telnet is both a protocol for connecting a local computer to a remote computer and a TCP/IP application. Telnet i

State the process of development of object oriented analysis, The Process o...

The Process of Development The approach to development can be an iterative one. It involves repeated refinement of the object model. The process needs to be controlled by an a

Determine the concepts of object oriented analysis, Determine the concepts ...

Determine the concepts of Object Oriented Analysis  In OOA the initial focus is on identifying objects from the application domain, after that fitting those procedures around

Illustrate what is a crest, Q. Illustrate what is a crest? Answer:- ...

Q. Illustrate what is a crest? Answer:- In electromagnetic waves or else ocean waves for that matter a crest is the peak or maximum height of the waveforms. A channel is t

Explain the term- wireless technologyand broadband, Explain the term- Wirel...

Explain the term- Wireless Technologyand Broadband Wireless Technology (WiFi) and Broadband Most areas in the world now provide broadband instead of dial up for connectin

Write Your Message!

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd