I need to use a regular expression to get a couple of items for my python script. So far the script is running an 'ls' command to get a few items that I need
I run an 'ls -sk /xen/domains2/machinename/disk.img' Output 2454112 /xen/domains2/machinename/disk.img Then I have it running an 'ls -lk /xen/domains2/machinename/disk.img output: -rw-r--r-- 1 root root 20980736 May 2 10:05 /xen/domains2/machinename/disk.img Then I take those two number and divide them using the the used amount by the actual size of the disk to get a percentage. I take all of that data and then stick it into a database. What I need to get is just the size numbers using regular expressions. I tried using an index, but since the disk images can up to 20 gig and be as low as 5 gig...the index changes. I also need to get the 'machinename' portion of the path as well to stick into the database. -- Spencer Parker _______________________________________________________ "if you can't go to heaven, may you at least die in Ireland." _______________________________________________________
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor