From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 08 11:28:32 2023 Received: (at submit) by debbugs.gnu.org; 8 Jun 2023 15:28:32 +0000 Received: from localhost ([127.0.0.1]:57227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7HYq-000309-0M for submit@debbugs.gnu.org; Thu, 08 Jun 2023 11:28:32 -0400 Received: from lists.gnu.org ([209.51.188.17]:50532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7DoD-0002As-Qh for submit@debbugs.gnu.org; Thu, 08 Jun 2023 07:28:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7DoD-0003uu-ED for bug-grep@gnu.org; Thu, 08 Jun 2023 07:28:05 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q7DoB-0008BB-LU for bug-grep@gnu.org; Thu, 08 Jun 2023 07:28:05 -0400 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f655293a38so182053e87.0 for ; Thu, 08 Jun 2023 04:28:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686223681; x=1688815681; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=SMkZAk7oFGXr45R4MaY7gbYBwcZUPTUxFCdm8ZEonFg=; b=GREkOwnyOdnFlMXGS98EUDNSYGz2L2Rc3Iiy88ToWce2y/DlTWFvG9UnFXXprPyxPN CisBlkB87rbCg6BdFAUm+EoaUKFurP3PPNJlPBTdzpqxiTfgvj9Zi/3Yl4nQs7Bm+xGx KGyJkN/seK8lwSccCifxC7nkTpu4d8twqSUV/gMaFQNKfclXAHklA/JU3okNaYo+4PQN 618t7R95prxAMBGAKGnRRhaq7eopg0u3p8SpgCLjDo/91uU1Z53Kp4AAW7Pu0xMq4pZa xq3vltRf5QRZ8hqcd4Dx7oa2z2Lkg/awLrg3rQm7SPXxpv8HFzD+xcrN5X+3o1HPe16k s2+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686223681; x=1688815681; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=SMkZAk7oFGXr45R4MaY7gbYBwcZUPTUxFCdm8ZEonFg=; b=KsrZaMPtPwxyULpLMGdS0JpWDj+dW/7CNYsI57PgVOc3T042q8EWs1lOh4yjdzfQyx SsxDB9PVwbfN0K8z7JhDQ1MIqXqUKaOaAo7yzfw600/OIc3hyJDphSfvIq1GqwSRCDhE hTr/rqKgF/mzul6iJTuBJkxlxIr20ysfGY40YM7VAVwffJDSjto1iBRknYfqc82dvLpk La6V+1vq3CdGlvQiDCnAcN9S+jA3AFgDV+fAoxtUwrYf26LNLjAZJq90ZRk2lCP607z2 1IxFi64CXVFH87AyxH8Rq9b/oJHB+TOnmYyM/iOuGXMUlSIzwzVTFqraUId+aWE7mTRU Bcyw== X-Gm-Message-State: AC+VfDwz+e3k6Qtm/s4bWJjQjvClB/UTlngGM7j7HQzkUrP5kgvN82wR A2xgqZJrHzOXZB9PhV1LFPlsuz4J0s3UkzBFLUGbPTl1Xqo= X-Google-Smtp-Source: ACHHUZ6wDg1yVu7WPqzjuVlu12F8w/WypxtCmbMZYo+6lhiFhnd/jSstXP1g5bevV6dTd4E/5RL3hNOyzD+iJtN2gHM= X-Received: by 2002:a2e:b008:0:b0:2b1:da62:2a86 with SMTP id y8-20020a2eb008000000b002b1da622a86mr3467060ljk.33.1686223680563; Thu, 08 Jun 2023 04:28:00 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?B?0JLQsNGB0LjQu9C40Lkg0JDQu9C10LrRgdC10LXQvdC60L4=?= Date: Thu, 8 Jun 2023 14:27:49 +0300 Message-ID: Subject: possible error in the grep program To: bug-grep@gnu.org Content-Type: multipart/mixed; boundary="0000000000007e1fb705fd9c8b25" Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=vasilisc777@gmail.com; helo=mail-lf1-x12b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, 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.1 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 08 Jun 2023 11:28:26 -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.1 (--) --0000000000007e1fb705fd9c8b25 Content-Type: text/plain; charset="UTF-8" Hello, in my work, I encountered a possible error in the grep program. $ grep -V grep (GNU grep) 3.4 1) The initial list of IP addresses in the file is formed start_list.txt . 2) Must be removed from the list start_list.txt IP addresses using a larger file exclude_list.txt grep -vF --file=exclude_list.txt start_list.txt > list_grep.txt 3) But after a series of checks, it turned out that grep "loses" 3 IP addresses 10.0.23.48 10.0.27.40 10.0.38.43 4) A bash script was written that solves the same problem in a different way #!/bin/bash :> list_while.txt while read l do if ! grep -m 1 -q "$l" exclude_list.txt; then echo ${l} >> list_while.txt fi done < start_list.txt 5) The diff program has confirmed that there is indeed a difference in the results $ diff list_grep.txt list_while.txt 22a23 > 10.0.23.48 24a26 > 10.0.27.40 28a31 > 10.0.38.43 -- Best regards, Vasilisc --0000000000007e1fb705fd9c8b25 Content-Type: application/x-gzip; name="bug_grep.tar.gz" Content-Disposition: attachment; filename="bug_grep.tar.gz" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lin1wn1l0 H4sIAAAAAAACA+2a727eNBTG+7lXkQ2+Lot9fOwY0G5lWrd3a6WyQtuJSYh7JynJ83MHbAi1hYIf VeoTx+dPbJ/jE+c9+fDu5bvLww/Pj+4P04LifvN/waf/b3hIKU1mIVk8mkKwlI4GP3oAfLi6fnU5 DEeXFxfXn+v3pfuPFCf7/J+fXV2//On07PwwXn+8vvP5z8uE/tn8e4j7/FtJYZn/FN2OhqnP/70j TOM0htGm4435xuIY0s7KxtIYxdLWL4/JduZJbN5ZhtXNBkZWut0PCScW7WGjPqYoOu8dFqNF1KNo 2VyJUf6tdFMWbUybtZhG942W5U9UYvOYtw7m0rBQ30xY0YPbvNJHHv+Hj6/PP7w5vFzzwB1ngM/H f5iS2Rb/scTJ1/j34j3+HzD+w6QEECaDOrQoZAPRGwLUoIhFWEOrKEKGKqOrJbUmzCb6Jvqmpq9D cdwRcww7Yo7jTrbKjE0O0EiHhqJsz3wLLbhe8KEgVnByxtqMO3OGorfStzJrVWJR0xpHxj8arGlM og1Lkk9ohe1eGbMzmly1IqYZp58mMWmrWTcBjXCiMTU7Q4QatOmbRR0Lmm8avVn1K2/bY8Ot4anh BR4aWS1+HxtqWDI6G3YM1daIaSyd+wld7T6JlIbAWf2uvW+lmg5HylHbjJHjojMSjTetBuw6dh27 CionqBaKtYy1jLWMtYy1jLWMtcyj0ViwULBQsFCwULBQsFAaZTxP4XnmpkxB74zemb6VZ694VtFQ 0VDRUDFcq2qeoCWiYcoskcwSycQORdtKGzGnqkKD04EEqdHPzF9m/nLrTUZtpm4rDZ1FZzRUXNAw leUPuosxlYVIo5hbKQo0ClRwK3VohmLMUeYoc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o6Ojo+Nx41dF5HYTAFAAAA== --0000000000007e1fb705fd9c8b25-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 08 17:07:29 2023 Received: (at 63962-done) by debbugs.gnu.org; 8 Jun 2023 21:07:29 +0000 Received: from localhost ([127.0.0.1]:57693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7Mqu-000614-O4 for submit@debbugs.gnu.org; Thu, 08 Jun 2023 17:07:29 -0400 Received: from mail.cs.ucla.edu ([131.179.128.66]:40412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7Mqp-00060n-BW for 63962-done@debbugs.gnu.org; Thu, 08 Jun 2023 17:07:27 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 304F23C02213D; Thu, 8 Jun 2023 14:07:17 -0700 (PDT) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id w0NP26VkcOC3; Thu, 8 Jun 2023 14:07:16 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id AE83A3C09FA06; Thu, 8 Jun 2023 14:07:16 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu AE83A3C09FA06 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1686258436; bh=FXW8zPTsVeoaexMKl1UzVLbx88k6qTqo9n4rRxPUNQU=; h=Message-ID:Date:MIME-Version:To:From; b=dqT2MU/AX/j5roau9hNo7gTqLcH8I2OvTOVLaRRc6CALTefsigsCxlNxdX0p6KxQx eM99CL6fF7WR3fSkUsRYnTBieGp/lYUb6RXwY74yEM0Rn3Qjiyui656FIRDx7tHdnH qqp54pObIZH+FszFsinEAPy0JP7eBNXcYI5s0E77ikfkDwNauR3wcqKtSogoz9W4Se ZqhNaFE7Y6bVL++iDLv/REtKc2GS7/f2Wnl1HWUfgMm3w/tG6yrT6XanPoPNTGxaay SiKPEbUI3GlC0ImhqgKlG3U5/bCarM48ZQLTh7cqCJyEWg7QH7TPd5DzIiKH2vdpwZ nwtxDwalY5r8Q== X-Virus-Scanned: amavisd-new at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id CoAT-gfkMuaU; Thu, 8 Jun 2023 14:07:16 -0700 (PDT) Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 9BF5B3C02213D; Thu, 8 Jun 2023 14:07:16 -0700 (PDT) Message-ID: <3c1dc8f7-6808-85ab-c27f-4738aa718068@cs.ucla.edu> Date: Thu, 8 Jun 2023 14:07:16 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: bug#63962: possible error in the grep program Content-Language: en-US To: =?UTF-8?B?0JLQsNGB0LjQu9C40Lkg0JDQu9C10LrRgdC10LXQvdC60L4=?= References: From: Paul Eggert Organization: UCLA Computer Science Department In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: 63962-done Cc: 63962-done@debbugs.gnu.org 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.1 (--) On 6/8/23 04:27, =D0=92=D0=B0=D1=81=D0=B8=D0=BB=D0=B8=D0=B9 =D0=90=D0=BB=D0= =B5=D0=BA=D1=81=D0=B5=D0=B5=D0=BD=D0=BA=D0=BE wrote: > 1) The initial list of IP addresses in the file is formed start_list.tx= t . >=20 > 2) Must be removed from the list start_list.txt IP addresses using a > larger file exclude_list.txt >=20 > grep -vF --file=3Dexclude_list.txt start_list.txt > list_grep.txt The line '10.0.23.4' in exclude_list.txt matches the line '10.0.23.48'=20 in start_list.text. That is, the first line is a substring of the second=20 line. So this usage of 'grep' doesn't do what you want. To get the effect you want, also use the -x option. E.g.: grep -vxF -f exclude_list.txt start_list.txt From unknown Sun Jun 22 00:22:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 07 Jul 2023 11:24:10 +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