perl: get quotas and print on webpage
Hello
I'm trying to sort out quotas for my users, however, I'm having real problems working with perl. What my script should do is to get the user's quota and usage using repquota -a. Then grep and awk the lines in order to get the correct digit. here is code at the moment: Code:
#!/usr/bin/perl As you can see, it doesn't work, and I'm having touble finidng out why. 1. it seems to print the the variables $quota and $usage at the very top. I don't really understand why. 2. the script doesn't seem to divide the $quota and $usage variables by 1024. It just puts the $quotamb and $usagemb to 0. So my question is: (a) what am I doing wrong, and (b) how can I get it working like I want? Thanks in advance for all your help. hamish |
FYI, system() rtns the exit status of the called cmd, not the stdout (or stderr) of the called cmd.
I recommend you try this module: http://search.cpan.org/~tomzo/Quota-1.5.0/Quota.pm HTH |
All times are GMT -5. The time now is 07:13 AM. |