From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 01 04:45:19 2022 Received: (at submit) by debbugs.gnu.org; 1 Jun 2022 08:45:19 +0000 Received: from localhost ([127.0.0.1]:49682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwJyg-0004qV-Nr for submit@debbugs.gnu.org; Wed, 01 Jun 2022 04:45:19 -0400 Received: from lists.gnu.org ([209.51.188.17]:34154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwJIS-0003ia-44 for submit@debbugs.gnu.org; Wed, 01 Jun 2022 04:01:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwJIR-00048B-1V for bug-coreutils@gnu.org; Wed, 01 Jun 2022 04:01:39 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:39510) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nwJIL-00028O-N4 for bug-coreutils@gnu.org; Wed, 01 Jun 2022 04:01:38 -0400 Received: by mail-wr1-x42b.google.com with SMTP id x17so1169982wrg.6 for ; Wed, 01 Jun 2022 01:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=Lprp2Fpvoezsyp3VsJT2TkOSIQMinwc4LRP57SYlW6E=; b=g99Vp4Mju4S6nD23QDxYuaWkAGZCpjc0T/ZkeGti5UR3EPUGhaieTkYKAGkNjrs9DS 5qojgP+oEmfqkcTF7XH9aZDOL//xxBTNxcBpnKnMZPG++kSef0Y3h0EJxwmHiEpANDRZ 8shrS/uc0A5LH2euSVuRgJL7c1sD/9yZUGNzHdHvLohJpIxad4YATwW5hLk3ZtWb6/i1 einTEzd7lu8rofcPJZAZpiL6R8xaWwxM/KGl8XxB3xh9nwdMkGI4VERbFih4Ut12DngR 4bQ5V+RoY+Vo7TUdiqBz8RU9VrPu10zcDAnaAYlxP+wsPtFCdhbagOyvdJFMl/7r1y9O Sn2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Lprp2Fpvoezsyp3VsJT2TkOSIQMinwc4LRP57SYlW6E=; b=BN1h44LoYZHFIUH0fQ7t/0QHEEw7FxJwS3l44MfQlWCZwrtkv7e0tyaJMNuOE21Mb0 Cqah4fPFji6rx0uG6Cp6OqWgomOLZMmOwIe7U0ZX3VtNL9RJsUZhNIwqm0g0zSRgKWPL Tp9MihMoYLHuJusLd8ZJ31drSI6bDEsC+NeNGV4R0d6SjEynK/R2pLkWeLSDD216ClgJ 3AOwFz/aInyebxDbx1LYbR5XmziVkCA9ZJn4m/CIfkXiRB/l2/3eB8aWD6qjLhtrkAx2 Uc95TBNg66tvKGnDzEfpzH849i1UsvqfWmegf3wPJlLPQkhU7NKgy1vj5h7tbVvkHvY4 19sw== X-Gm-Message-State: AOAM531mZ3uRrBoq7wzPV8wG0CwnXIKTOJcjYIicwsYHi0Zskf2D+lER L5HeczZaYdw2pyj7TFnRXDDEkv+XEN0Ri8qPnjwaqtJTGWM= X-Google-Smtp-Source: ABdhPJzOvudZmUzHqcpubVgiWeM/fOnM7stYHrMTpl3gN58EibaqmyQr7S6WqQoHP2+wUniwIRvPLlBhCE3XxCk67WI= X-Received: by 2002:a5d:64c2:0:b0:20f:dc21:e658 with SMTP id f2-20020a5d64c2000000b0020fdc21e658mr40637636wri.508.1654070490678; Wed, 01 Jun 2022 01:01:30 -0700 (PDT) MIME-Version: 1.0 From: Daniel Hofstetter Date: Wed, 1 Jun 2022 10:01:19 +0200 Message-ID: Subject: df: wrong column is checked in condition in total-verify.sh To: bug-coreutils@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=dhofstet@gmail.com; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 01 Jun 2022 04:45:17 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 01 06:03:56 2022 Received: (at 55748) by debbugs.gnu.org; 1 Jun 2022 10:03:56 +0000 Received: from localhost ([127.0.0.1]:49769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwLCY-00071d-LK for submit@debbugs.gnu.org; Wed, 01 Jun 2022 06:03:56 -0400 Received: from mail-wm1-f46.google.com ([209.85.128.46]:40706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwLCS-00071G-Sn; Wed, 01 Jun 2022 06:03:41 -0400 Received: by mail-wm1-f46.google.com with SMTP id v4-20020a1cac04000000b00397001398c0so2691445wme.5; Wed, 01 Jun 2022 03:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=wBATn5jMbx0bukhME3g/KR93N3kivkELE5BX4kaAfcE=; b=eLtSyoqTUqmY3TCWdd2bfK2uT1VSf0q9+m+TgVaRiAEzMchw8qX2GuDiKdIxwFW9Gc sua0tlTxp5vSUylhvFCXV7966fV0arcYExduAqEbM/x4YHo6MzlK0+W+q//eAPVwO/ug Qkvi32OVt0L7h7pd2w8YTtTElvKDkchEVOifmgRzr90rfYvWWmn3Vd+V0wb0x2Xxehiq Ekq+/yMP3/aht6xlgJ/urwD6lMzIVemVhtl6VHGvkpYEfAMtWmhtMLNrBEkjU3ivizzM 8NyzSgvZWvA2f/mux8if1FJ89eLdAKowtpZ1K+SHF38XY4KKl+cARrNVMYEMYkC2qquL JKfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=wBATn5jMbx0bukhME3g/KR93N3kivkELE5BX4kaAfcE=; b=prrwP5vdk/z5TRh6R4F5nIktVooBUPcghNrWPzR4BBhm3M1+5NGpkk+OyeYjJV6mpA mwh1p6YZH/RIHNa4aK7rvdIUaJYmiNDaylVCiPaByJ/tZInoxHpJBFgZpAVV5ATVHZ+E hRWNs5aNyzrGZYGLZ6/olv94ajyT3yJ6eeY2UB2GRiwcXLcnt9Bq2PHJTz/RUxwgQoTD vKKWnD2pAuHloYlH3oiW+EH5Wd5fpV7OtBXhjFCP193kMqYVym+XEEp6BWtNAwSVNHCx //t7UvVBQELCOZW6fa+tyn/5LxLRP/AigHqMy4kHuhCJTsncuH5AbpLPyOUXqlhVCYB0 t6+w== X-Gm-Message-State: AOAM533jaHnK/id6au2P8sUIqqWNn+3RTOKZRxANpR3nf2xnS1xJlDM3 j4KQXt4bwKJVzoJL8zT2PgI= X-Google-Smtp-Source: ABdhPJzfKJqQex9h5GkJ1PMei8mRAIPyfayfMZ2XdHs+wnRbZyJUlACNoC1fuaDeKUFzo+NMEoYy/A== X-Received: by 2002:a05:600c:4e16:b0:397:6d34:76a4 with SMTP id b22-20020a05600c4e1600b003976d3476a4mr27785607wmq.0.1654077810792; Wed, 01 Jun 2022 03:03:30 -0700 (PDT) Received: from [192.168.1.9] (95-44-90-175-dynamic.agg2.lod.rsl-rtd.eircom.net. [95.44.90.175]) by smtp.googlemail.com with ESMTPSA id b18-20020adfde12000000b0020d0f111241sm1156705wrm.24.2022.06.01.03.03.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Jun 2022 03:03:30 -0700 (PDT) Message-ID: Date: Wed, 1 Jun 2022 11:03:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Thunderbird/98.0 Subject: Re: bug#55748: df: wrong column is checked in condition in total-verify.sh Content-Language: en-US To: Daniel Hofstetter , 55748@debbugs.gnu.org References: From: =?UTF-8?Q?P=c3=a1draig_Brady?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 55748 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) tag 55748 notabug close 55748 stop On 01/06/2022 09:01, Daniel Hofstetter wrote: > 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 '-') Notice the non capturing group, i.e. (?:) This is because the percentage column is not needed in the subsequent processing. I.e. the following would work, but isn't needed. cheers, Pádraig diff --git a/tests/df/total-verify.sh b/tests/df/total-verify.sh index 87589d23d..d3f109d97 100755 --- a/tests/df/total-verify.sh +++ b/tests/df/total-verify.sh @@ -33,9 +33,9 @@ while (<>) # /dev/sdc1 0 0 0 - /c # tmpfs 1536000 12965 1523035 1% /tmp # total 5285932 787409 4498523 15% - - /^(.*?) +(-?\d+|-) +(-?\d+|-) +(-?\d+|-) +(?:-|[0-9]+%) (.*)$/ + /^(.*?) +(-?\d+|-) +(-?\d+|-) +(-?\d+|-) +(-|[0-9]+%) (.*)$/ or die "$0: invalid input line\n: $_"; - if ($1 eq 'total' && $5 eq '-') + if ($1 eq 'total' && $6 eq '-') { $total == $2 or die "$total != $2"; $used == $3 or die "$used != $3"; From unknown Thu Aug 14 18:37:09 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 29 Jun 2022 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator