Create new user account - system administrator, Computer Engineering

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.

Posted Date: 3/20/2013 1:04:28 AM | Location : United States







Related Discussions:- Create new user account - system administrator, Assignment Help, Ask Question on Create new user account - system administrator, Get Answer, Expert's Help, Create new user account - system administrator Discussions

Write discussion on Create new user account - system administrator
Your posts are moderated
Related Questions
The First In First Out method assumes items of stocks are issued in the same order as they are received. Thus the goods received first are assumed to be the first to be issued .Any

Q. Illustrate Characteristic tables of flip-flops? Excitation Tables Characteristic tables of flip-flops present the subsequent state when inputs and present state are kno

a) Prototype a macro known AP which takes 4 integer parameters n (number of terms), a (first term), l (last term) and Sum (sum of n terms), provided that: Sum = (a+l)*n/2 b)

For JK flip flop with J=1, K=0, the output after clock pulse will be ? Ans. The output will be 1 after clock pulse.

Define the types Programmable logic devices? There are mostly three types PLDs. These are vary in the placement of fuses in the AND- OR array. 1. ROM- It has fixed AND array

What are the different modes in that 8255 Programmable Peripheral Interface (PPI) can operate?  24 I/O lines in 3-8-bit port groups - A, B, C A, B can be 8-bit input

Static and Dynamic Interconnection Network In a static network the connection among input and output nodes is permanent and cannot be changed. Static interconnection network ca

Nonvolatile BIOS memory refers to a small memory on PC motherboards that is used to kept BIOS settings. It was traditionally known as CMOS RAM because it used a volatile, low-power

draw circuit diagram and the truth table that represent demultiplexer

With the help of a neat diagram, explain the working of a weighted-resistor D/A converter. Ans Weighted Register D/A Converter:   Digital input that has 4 bits