On Thu, Jun 14, 2001 at 08:52:56PM +0200, shadout@club-internet.fr wrote:
Hi everybody, thank's for the help. i've now an other problem : i want the script to tell me when a directory has a size up to 500M. i can't get it with du -hs /mnt/charlie/backup because it shows size of the directory and the name.
here is the code i've done : for size in ( du -hs /mnt/charlie/backup ); do if [ $size = 500M ]; then echo Need to rip a CD fi done
I don't know what du -h does, but if you only want to extract one part of the du report, then I guess you want to have a look at 'man awk'. e.g. to give you the first column: awk '{print $1}' -- David Smith Tel: +44 (0)1454 462380 (direct) STMicroelectronics Fax: +44 (0)1454 617910 1000 Aztec West TINA (ST only): (065) 2380 Almondsbury Home: 01454 616963 BRISTOL Mobile: 07932 642724 BS32 4SQ Work Email: Dave.Smith@st.com Home Email: David.Smith@ds-electronics.co.uk