bash script help - finding last n log files in all sub folders
I am quite a bit puzzled by the following scripting need:
I have a tree of subfolders, starting from a root named "logs". There can be any number of knots, I will call them a, b and c in this attempt to explain things. Each knot can have n leaves, let's name them a1, a2, a3 and b1, and b2.
Each leaf folder will store log files, whose names are like YYYY-MM-DD.HHMMSS.log
The script I need will have to return the last n log files for every leaf, where n is as script parameter passed at runtime.
So it would look like this:
jeepescu@gondolin:/$ . myScript.sh 2
Now, is bash scripting a good tool for writing such a thing, or should I start looking into perl, python or other creature ?
Thanks in advance.