Write a PERL program that scans the user file
/etc/passwd from a unix system such as
cegt201 or students and generates the
sorted by name list of student Web pages with links to those
pages in HTML format.
The final version of the porgram will be tested on a Unix
system but you can develop and test it localy by FTPing the
/etc/passwd file to your localmachine. Just remeber
to change the hardcoded file name to /etc/passwd
before submitting the program. The output file should be called
students.html and should be created in the folder where the
program is run. (stream/pipeline version of the program wit no
file names hardcoded is also acceptable but pipes may not be
explained in class before the homework is due.)
The structure of the /etc/passwd file is as
folows: A typical line looks like
olekmali:x:3047:10:Aleksander Malinowski:/home/sta
ff/olekmali:/usr/bin/tcsh and that translates to the
description
$USER:undef:undef:$GROUP:$NAME:$HOME:undef
where undef denotes unimportant text field that
even may be empty in some cases. You can expect several hundreds
of lines with user information in the input file.
For students $GROUP equals 11. You can assume that a student
has a Web page if there exists a folder located at
$HOME/public_html that is accessible
(readable).
The output fille should a full feature valid HTML 4.0 file. A typical entry
in the output file can look like
<BR><A HREF="/~$USER">$NAME</A>.
Please use use Strict;. Your program will be run with
-w PERL compiler option. To ensure maximum program speed and receive full
credit use regular expressions in filtering the input file.
Print the list of student Web pages sorted by family name instead of just by name. Do not submit another program, just implement this more complex sorting in the original program. Family name is defined as the last word in the name
Attach all source code in files with proper names and extensions (*.html, *.java, *.pl, *.php, .htaccess e.t.c.). Do not ZIP files together or include compiled files (e.g. *.class). In case of Web pages (HTML), dynamic Web pages (HTML, JavaScript, CGI) or Java applets also send the complete URL (including http://) that points to a page on your Web site that demonstrates your homework. Send your homework via e- mail to the instructor at olekmali at cegt201.bradley.edu. Please set the message subject to: web-hw9.
Thank you.