basically i'm making a script that monitors how much Bandwidth has been used for the current month on a particular server.
this information is then to be output on a particualr command in a channel
so what i need is to know how to readin the output from a shell command
i.e. this is what an output in shell would look like:
Code: Select all
$ vnstat -m
inet (eth0)
month rx | tx | total
------------------------+---------------+---------------
Mar '03 15,959 MB | 18,823 MB | 34,782 MB
Apr '03 24,645 MB | 20,440 MB | 45,085 MB
May '03 31,314 MB | 39,103 MB | 70,417 MB
Jun '03 28,116 MB | 42,988 MB | 71,104 MB
Jul '03 27,552 MB | 33,924 MB | 61,476 MB
Aug '03 37,498 MB | 38,189 MB | 75,687 MB
Sep '03 19,750 MB | 17,488 MB | 37,238 MB
Oct '03 3,999 MB | 4,492 MB | 8,491 MB
------------------------+---------------+---------------
estimated 18,479 MB | 20,758 MB | 39,237 MB
Code: Select all
Mar '03 15,959 MB | 18,823 MB | 34,782 MB
so what i want to know is how i would go about reading that input in...
i.e how does tcl do it.... line by line etc., can i just take out line 6 easily??
any help on this would be great.
thanx in advance
Turbo