[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] maint: simplify parsing df's output in shell scripts
From: |
Pádraig Brady |
Subject: |
Re: [PATCH] maint: simplify parsing df's output in shell scripts |
Date: |
Fri, 04 Jul 2014 04:09:53 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
On 07/04/2014 12:57 AM, Bernhard Voelker wrote:
> Avoid complicated and error-prone parsing of df's output via
> sed(1), cut(1), etc., and instead use df's more modern --output
> option.
>
> * src/ioblksize.h (in a comment): Simplify the extraction of the
> device name of the mounted file system from df's output.
> * tests/dd/skip-seek-past-dev.sh: Likewise.
> * tests/du/2g.sh: Likewise for the 'avail' column here.
> Also avoid the deprecated use of "tail -NUM".
> * tests/misc/stat-mount.sh: While at it, remove the determination
> of the mount point of "." via df(1) plus sed(1) as it is unused
> since commit v8.5-159-gf57cb37 anyway. Instead, improve this test
> by verifying that the output of "stat -c%m ." at least starts with
> a slash '/'.
nice cleanup,
thanks!