|
我是在職學生, 最近工作有點忙, 所以功課的進度趕不上了, 所以想請大家幫我解決星期一要交上去的功課, 感激不盡.
1. write a script, given a directory as argument (also search for subdirectory), print the longest filename in that directory. ensure the script has error checking. for example, is the argument a directory, not a filename?
2. write a script that finds each line in a file that contains a special substring (not a regexp). to test the script create a file of at least 20 lines. the script should print the result in the following format:
Line Number: Line contents
Do not apply regexp to the whole file but loop over the file line by line.
ensure the script has error checking. for example check that the argument is a file.
3. write a short script that accept any number of arguments, prints the name of the file that is newer. ensure the script has error checking.
4. write a script that creates a table out of the information in the /etc/passwd file using the following format:
User Name User ID Group ID Home
--------- -------- -------- -----
Apple 123 123 /home/apple
4題, 我能解決的都已經解決了, 剩這4題我還真的不太會, 只好麻煩大家.
謝謝. |
|