View the step-by-step solution to:

Question

I need help with the following task: See screenshots below. I already have the text file in my vm

src="/qa/attachment/10830390/" alt="Screen Shot 2019-11-01 at 8.26.30 PM.png" />

Screen Shot 2019-11-01 at 8.26.42 PM.png

Screen Shot 2019-11-01 at 8.26.30 PM.png

Due to the high volume of user accounts which must be managed at the organization,
the payroll department has decided to provide a data file which has the required
information on the new employees. This allows the IT department to write a script to
create new accounts.
The file is called employees.txt and is located in the Resources section of SAKAI under
a folder called Other. Copy this text file to your Linux VM. The employees.txt file has
the following format:
<first_name>
<last_name>
<Jag#>
<email>
Each record item is on a single line with a NEWLINE character at the end. The data is
repeated for each additional record with a blank line separating each record. The last
record of the file does not have a blank line after it. If there are additional records, the
record will be created on a new line.
The first step of the project is to create a script to parse the data and put it in the
following format:
<first_name>:<last_name>:<Jag#>:<email>
Write a script that will take the data file provided by the payroll department and create
the output in the colon delimited format. First, make it work by displaying the output to
STDOUT. Once the format is working properly, send the output to a file
~/Documents/users. Then we can move on to part 2 of this project.

Screen Shot 2019-11-01 at 8.26.42 PM.png

Once the employee data from the payroll department is in the correct format
(Part 1 of this project), a script should be written which will parse the new data
file and create the accounts using the useradd command. The accounts should include the user’s name as a comment. The userid and
password should be set to the user’s Jag#. There should also be a home
directory created for the user. To validate that the script is successfully creating the user accounts, you should
try to login as one of the users. An additional script should be written which will remove the accounts created
from the data file. This should also remove the user’s home directory. Naming conventions: Script to parse data file should be named dfp.sh
Script to add users should be named au.sh
Script to delete users should be named du.sh

Top Answer

May be you can try this code. I just tried this code. 001 #include <iostream> 002 #include <fstream> 003 #include... View the full answer

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question