[brlug-general] [SAGE] df breaks scripts
Dustin Puryear
dustin at puryear-it.com
Mon Feb 4 10:43:52 CST 2008
But I think you're missing the point. Since days of yore, people have
generally used 'df' with the assumption that it had sane output by
default. ;)
Now whether that assumption was valid is another discussion. I would
simply like to point out that you can infer that this was a COMMONLY
held assumption by the MAJORITY of UNIX admins across all of UNIX-land
simply by looking at any script ever written that uses 'df'.
I would be willing to wager that 99% of those scripts use 'df' in the
way that I and others that have responded to this thread so far use it:
$ df | awk ...
--
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
Derek J. Balling wrote:
>
> On Feb 4, 2008, at 10:15 AM, Dustin Puryear wrote:
>> 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?
>
> Yes, and that's why "-P" exists. Because people were bitten and while
> the MAJORITY of "df" usage is "live humans", occasionally there's a need
> to be machine-readable, so "-P" is at your beck and call for all
> scripted applications. :-)
>
> Cheers,
> D
>
More information about the General
mailing list