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

username:

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

passwd:

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

Name the abap/4 modularization techniques, Name the ABAP/4 Modularization t...

Name the ABAP/4 Modularization techniques. Techniques are:- Source code module. Subroutines. Functions.

Binary resolution, Binary Resolution: However we saw unit resolution f...

Binary Resolution: However we saw unit resolution for a propositional inference rule in the previous lecture:  (A?  B,   ¬B) /A Thus we can take this a little further to

Name the variable types of c, C provides a wide range of variable types. ...

C provides a wide range of variable types. Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

Determine about the virtual private networks, Virtual Private Networks (VPN...

Virtual Private Networks (VPN) In order to encrypt/decrypt all the communication network traffic that passes through the Internet or Intranet, a VPN uses software or hardware.

Explain the main tags of wireless markup language, Discuss the main tags of...

Discuss the main tags of WML. Tag Definition of Wireless Markup Language: This defines the starting and the ending of the page, as .   this explains

How firewalls operate, Firewalls operate by Creening packets to/from th...

Firewalls operate by Creening packets to/from the Network and give controllable filtering of network traffic.

Explain the fork-join, Explain the fork-join? fork-join: It is prim...

Explain the fork-join? fork-join: It is primitives in a programming language of higher level for implementing interacting processes. The syntax is as given below: fork

What is strong-typing versus weak-typing, What is strong-typing versus weak...

What is strong-typing versus weak-typing? Which is preferred? Why? Strong type is checking the types of variables as early as possible, usually at compile time. Whereas weak ty

Define dynamic linking, Define dynamic linking.  Dynamic linking is sam...

Define dynamic linking.  Dynamic linking is same to dynamic loading, rather that loading being postponed unless execution time, linking is postponed. This feature is usually us

Determine flip-flops that are required for mod–16 counter, How many Flip-Fl...

How many Flip-Flops are required for mod-16 counter? Ans. 4 flip-flops is required for Mod-16 Counter. For Mod-m Counter, we require N flip-flops where N is selected to be the

Write Your Message!

Captcha
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