i wont lie to you - this is about homework.
but i will not be asking you for a solution, merely discussing my own, which, in my eyes seems a bit overkill. (why? the course i'm forced to be doing at uni introduced us to _reeeaaaally_ __basic__ bash stuff, the lecturer isn't even aware of printf existing as a bash builtin - echo = GOD. so as you see, he isn't too enlightened in this particular field. but enough of that.)
we were tasked with writing five bash scripts, each of them pretty much dull - the usual ifs, checking for read/write access etc etc. pretty much all four are ENTIRELY about using ifs witht the right switches/flags.
one script is supposed to take the output of last and basing on it, print out the number of logins took place each day.
no problem, right? just read it line by line, awk out the date fields and use a simple counter to count how many times that date occurs. rinse and repeat for every day.
the problem is, we're not supposed to know what awk is. not even what a field is.
here is my question - am I right to think that my awk-based solution is way too complicated for the job and there's something painfully simple i'm missing?
how would you do this?
(not asking for a ready to use script, i can do those on my own. asking for other solution ideas!)
so, what do you think?