For "sed" see
For "AWK" see
For "find" see
See for "cut"
Write a bash shell script which reads a file containing user names
and creates home directories for the users (in a directory "home"
in your home directory) according to their names. If any name
appears more than one, change one name so each name is unique.
If the name is longer than 8 letters, truncate it. It should also
create the appropriate password file entry in a file called passwd
(also in your home directory). The program should take one parameter,
the file name. Only you should be able to run this program, use
environment variables to make sure who is running the program.
Write a shell script which adds users to the password file.
Make your own password file.
The script should make sure that the new account being made does not already
exist. It should check what is the next free uid and assign it to the new
account. If a password is not supplied in the command line, then take one
from an internal array. Encrypt the password by using shell16 above.
Also, handle errors, e.g. make sure only you can run the program.
Usage should be like this:
adduser [-p password] account_name
adduser account_name [-p password]
where the [-p password] is an option.
© Nachum Danzig 17 Dec 2002