What exactly do you need help with? Understanding the concept or something like that?
First, you should familiarize yourself with what wc actually does: http://www.computerhope.com/unix/uwc.htm
. It has quite a bit of functions for it. Also, "man" is your friend: http://pastebin.com/AfdZYZp8
I will try my best without giving you a direct answer, because school is school.
- For the first function, you have to count how many lines something is. There is a special char that dictates the newline function.
- As for the second, you have to read from a file and output how many lines is in there. Same principle as from above.
- As for the third, you basically mimic the second except with a file name.
- The fourth is also much like the second and third, however its an array of file names. So with that, just execute the third method for every file provided.
- The fifth is a simple help line. This is a basic return statement that displays information on how to use the command. Also, "-h" is synonymous to "--help".
Hope this helps.