MS-373
Advanced Unix
Lab 7
Date: Thursday, January 26, 2006
Due: Thursday, February 2, 2006
Writing
Simple Shell Scripts
Writing simple shell scripts is a basic task often done by Unix/Linux
system administrators. Many of their day-to-day tasks are
repetitive in nature and automating redundant tasks with shell scripts
makes their job more productive and enjoyable. The task we wish
to automate is that of creating and removing user accounts on our
system. Our use of the commands useradd and userdel were complicated by the
fact that these commands need everything specified on the command line
to do their job properly. Our objective is to write a shell
script that will be a more friendly, interactive version of these
commands. Write two shell scripts, one called adduser and one called deluser, which prompts the user
for all the required information and then calls useradd or userdel to do the work.
Obviously, these scripts should only be able to be run by root,
so make the necessary changes to your files to allow for this.
Read the man pages for useradd and userdel and
then read the shell scripting tutorial from
www.linuxcommand.org/writing_shell_scripts.php (there is a link to
this site on our course page
http://www.msoe.edu/~blessing/ms373 ). When you're finished
with the reading portion of the task, then you are ready to tackle the
assignment.
As always, a complete report that contains the steps you've written
to solve this problem must be demonstrated and discussed in your
report. If you have any questions about the content of the
report, please ask in class (for everyone's benefit).