Picture yourself as an assistant to our Computer Lab director, Mr. Mattus. Consider the demo program that erases all files that are older than one day. Modify it so that it also does erase empty folder with exception of the folder that is used as a starting folder.
Also alter the program so that it accepts the starting folder as the first command line argument, and the number of days old as the second argument. The first argument is mandatory, i.e. if none is specified then the program should stop with a brief instruction how to run it. The second argument is optional, and the number of days should be set to one if it is not specified or is less than one.
Take special attention when testing your program. You may want to test it on your computer on the following folders:
Instructor is not responsible for any damages caused by running this program. Do be careful!
Write a program in PERL that runs on Unix (for example on cegt201.bradley.edu or students.bradley.edu) and provides the user statistics. The program should open the following file for reading: "last |" and read the user information line by line. (type "last" command on Unix prompt to see what data are you going to read.) Then the progrtam should create two statistics: one for all telnet users (second column entry starts with pts...) and another for ftp users (the second column entry is ftp). Ignore liens with entries of other kinds. For each of those two statistics print results in the form of tables. The first column should list the user name and the second column should show the number of logins for that user. The entries in both tables should be sorted by the number of logins in the descending order.
See appropriate demo programs and modify them as necessary:
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. Please set the message subject to: web-hwA.
Thank you.