Well. My first Journal entry. I wonder what else is going to happen here...
I've gotten somewhat frustrated with the quota warning system that comes with Red Hat 8, and after spending some time looking through the various quota modules and scripts on CPAN and having tracked down a quota_check.sh script from the web, that originated on Solaris, I've decided to go ahead and try and refactor it into Perl, to see what can be made of it.
Partially I'm doing this as an exercise, and to stretch my knowledge somewhat. I'm not a shell-scripter in the slightest so it's going to be interesting, to say the least. [I've already fallen for Randal's sh2perl joke. *sigh* That'll teach me not to read it first.
I can easily remove all of the stuff that uses awk, since Perl can do it all internally anyway. That's one hurdle that'll be fairly straightforward to resolve. The hard part is that it (the shell script) seems to have chain-loaded a rather large pipe sequence into a variable, in several different places in the script, all of which include awk and sub-scripts for it.
Separating out the wheat from the chaff and making it look clean and maintainable, making it scalable, and safe... is going to be the really hard part.
Some of the initial prep was fairly easy, thank goodness and little coders who whipped up Getopt::Long. Some of the wild shell case syntax was obviated thanks to this little gem.
Lord only knows where this is going to take me, how long it will take me, and whether or not ultimately it will be generally more useful and pragmatic than what already exists, but it'll be fun finding out. =:)