Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- For this project, you will write a shell script to automate the creation and deletion of user accounts. The shell script you write should meet the following specifications:
- 1)It should be named “buser”
- 2)It should live in the /root/bin directory.
- 3)It should be executable by the root user.
- 4)It should accept the command line parameters in the following syntax:
- SYNOPSIS
- buser [-a] [-d] [-l] [--add] [--delete] [--list] [filename...]
- DESCRIPTION
- This documents the IT 240 version of buser. This program adds, creates or lists multiple user accounts from a provide list in the form of a file specified at the command line.
- OPTIONS
- -a, --add
- Make a user account for each username contained in the named file.
- -d, --delete
- Delete user accounts listed in the named file.
- -l, --list
- Display the user account line from /etc/passwd for each user account name in the named file.
- 1)When run, the script should look at the command line parameters and act appropriately.
- 2)It should use the file named at the command line as the source of accounts to act upon. The named file in the command line will be a list of user account names of unknown number. Each account name will be separated by a carriage return.
- 3) When creating/adding accounts, the script should also create home directories.
- 4) When deleting accounts, the script should also delete user home directories.
- 5)When listing accounts, the script should cause the line in /etc/password that corresponds to each account in the named file to be displayed.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement