Assignment #1

Due Midnight, Monday Sept. 21, 1998

Implement the following utility using either the Bourne "sh" or Berkeley "csh"

NAME

lookfor - look for a user in a local network

SYNOPSIS

lookfor [-a] username [hostsfile]

DESCRIPTION

The program looks into each host in the file "hostsfile" looking for "username" who might be logging into one of the listed hosts. The hostsfile contains the host names separated by spaces, e.g., zaxxon pitfall tulip .

If the hostsfile is not specified as an arguement, the program uses instead the value of the environment variable HOSTSFILE to get the host names.

The localhost should be added to the list of host names, if it is not already included.

The -a option is used to force the program to continue searching "all" hosts on the list (the default is to stop as soon as the user is found at one of the hosts).

Use "ping" to make sure that a non-local host is alive before trying to lookfor the username on the host.

SEE ALSO

/usr/sbin/ping, grep, rsh, who


Back to Assignments Page
Back to CS476/576 Home Page