Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9530162

Have any Question?


Related Questions in Computer Engineering

Question software introduce ability do you have a document

Question : Software introduce ability do you have a document management system to manage business processes. What is the purpose of a document management system?

Terry amp sons makes bearings for autos the production

Terry & Sons makes bearings for autos. The production system involves two independent processing machines so that each bearing passes through these two processes. The probability that the first processing machine is not ...

You are putting together a trip to kamino to pick up clones

You are putting together a trip to Kamino to pick up clones and need to take a group of droids along to help. You have 11 droids from which to select, and decide to take 4. How many different groups of droids could you t ...

Question suppose we have a packet switched network in which

Question : Suppose we have a packet switched network in which two stations A and B are always separated by four intermediate nodes/switches, i.e., the two are 5 hops apart. Suppose station A wishes to transmit 1 MB (1024 ...

What is equi-marginal principle why does it have to be true

What is Equi-marginal principle? Why does it have to be true at interior optimum?

Recently a government department is involved in the

Recently, a government department is involved in the development of an Online Passport Application Platform. The officers in the department are clear about the requirements of this platform. Besides, the functions of thi ...

Stuck in the mud is a popular dice game in uk the game uses

Stuck in the mud is a popular dice game in UK. The game uses five (5) 6-sided dice to play. The players play in turns. Choose one player to start the game. The player will roll all five (5) dice. If the player rolled any ...

The chancellor of a university has commissioned a team to

The Chancellor of a university has commissioned a team to collect data on students' GPAs (M = 3.0; SD = 0.5) and the amount of time they spend bar hopping every week (measured in minutes: M = 720; SD = 240). They find a ...

Question add referenceswrite 1 page that respond to the

Question: Add References Write 1 page that respond to the following questions with your thoughts, ideas, and comments. This will be the foundation for future discussions by your classmates. Be substantive and clear, and ...

Kingston corporation is considering a new machine that

Kingston Corporation is considering a new machine that requires an initial investment of $550,000, including installation costs, and has a useful life of eight years. The expected annual after-tax cash flows for the mach ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As