[brlug-general] df breaks scripts

Dustin Puryear dustin at puryear-it.com
Mon Feb 4 09:15:24 CST 2008


I've had problems with this in the past, and it's causing problems 
again. Sigh. df on Linux simply insists on wrapping text, and this 
breaks things.

For example, take a look at this:

$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                        8030648   4390580   3225556  58% /
/dev/hda1               101086     10839     85028  12% /boot
tmpfs                  1037880         0   1037880   0% /dev/shm
/dev/mapper/VolGroup00-LogVol02
                      141282016  64718168  69271332  49% /scratch
/dev/mapper/VolGroup01-BackupPC
                      196013428 142346300  43710164  77% /home/backuppc/data


This breaks a million scripts out there.

Yes, we can use -P to fix this, but how many scripts are out there that 
assume that.. oh, call me crazy.. that just a simple 'df' prints out 
output that can be properly awked?

Anyone been bitten by this?

-- 
Puryear Information Technology, LLC
Baton Rouge, LA * 225-706-8414
http://www.puryear-it.com

Author, "Best Practices for Managing Linux and UNIX Servers"
   http://www.puryear-it.com/pubs/linux-unix-best-practices

Identity Management, LDAP, and Linux Integration



More information about the General mailing list