EE-WEB Assignment 10

Program 1, 40pts.

Write a PERL program that scans the user file /etc/passwd.b4 on a Unix system such as cegt201 and generates an HTML file containing the list of student Web pages with links to those pages. The list should list users by their firs and last name but it should be sorted by the last name.

The final version of the program will be tested on a Unix system but you can develop and test it localy by FTPing the /etc/passwd.b4 file to your local machine. Just remember to change the hardcoded file name to /etc/passwd.b4 before submitting the program. The output file should be printed to STDOUT. The user of this program will redirect it to a file using > symbol on a command line, and then will post that file on a Web site.

The structure of the /etc/passwd file is as folows: A typical line looks like olekmali:x:3047:10:Aleksander Malinowski:/home/staff/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. For CEGT201 server you can assume that a student has a Web page if there exists a folder located at "/home1/$CHR1/$USER/public_html" that is accessible (-x file/loder test). where $CHR1 is the first character of $USER (extracted by you).

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; when testing your program on Windows and then remove that instruction before FTPing it to the Unix machine for the final test. 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.

Extra Credit Opportunity, up to 10pts.

Modify the program above so that there is a big letter displayed above a block of Web pages of users that their family name starts with that letter.

Homework Submission

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 dynamic Web pages (JavaScript or 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-hwA.

Thank you.

web site front local main page local list page print this page   general bookmarks software bookmarks go back close this page copyright info   visitor counter