|
I'm a working student, and I'm a bit busy recently at work, so I can't keep up with the progress of my homework, so I would like to ask everyone to help me solve the homework that I have to hand in on Monday. I am grateful.
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 questions, what I can solve has been solved, I really don't know the remaining 4 questions, so I have to trouble everyone.
Thank you. |
|