GNU bug report logs - #55748
df: wrong column is checked in condition in total-verify.sh

Previous Next

Package: coreutils;

Reported by: Daniel Hofstetter <dhofstet <at> gmail.com>

Date: Wed, 1 Jun 2022 08:46:02 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Daniel Hofstetter <dhofstet <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: df: wrong column is checked in condition in total-verify.sh
Date: Wed, 1 Jun 2022 10:01:19 +0200
Hi,

While looking at
https://github.com/coreutils/coreutils/blob/master/tests/df/total-verify.sh
I noticed the following lines and I think "$5" in the last line (line
38 in the source code) should be "$6" because there are six columns in
the df output and '-' is in the sixth column of the row starting with
"total".

# Recognize df output lines like these:
# /dev/sdc1 0 0 0 - /c
# tmpfs 1536000 12965 1523035 1% /tmp
# total 5285932 787409 4498523 15% -
/^(.*?) +(-?\d+|-) +(-?\d+|-) +(-?\d+|-) +(?:-|[0-9]+%) (.*)$/
or die "$0: invalid input line\n: $_";
if ($1 eq 'total' && $5 eq '-')

Regards,
Daniel




This bug report was last modified 3 years and 47 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.