From unknown Sat Jun 21 10:36:46 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#70860 <70860@debbugs.gnu.org> To: bug#70860 <70860@debbugs.gnu.org> Subject: Status: Add an option to remove filenames for wc util Reply-To: bug#70860 <70860@debbugs.gnu.org> Date: Sat, 21 Jun 2025 17:36:46 +0000 retitle 70860 Add an option to remove filenames for wc util reassign 70860 coreutils submitter 70860 Laurent Lyaudet severity 70860 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri May 10 10:30:51 2024 Received: (at submit) by debbugs.gnu.org; 10 May 2024 14:30:51 +0000 Received: from localhost ([127.0.0.1]:42344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5RGs-0002gP-2A for submit@debbugs.gnu.org; Fri, 10 May 2024 10:30:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:46930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5OYW-0008NM-N3 for submit@debbugs.gnu.org; Fri, 10 May 2024 07:36:53 -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 1s5OYQ-0001Nh-BY for bug-coreutils@gnu.org; Fri, 10 May 2024 07:36:46 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s5OYN-0005PP-PL for bug-coreutils@gnu.org; Fri, 10 May 2024 07:36:45 -0400 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a5a2d0d8644so245354566b.1 for ; Fri, 10 May 2024 04:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715341001; x=1715945801; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=ouRQof1aG5mSQ/m5TMHDu/QnInDv9THxiEzJbP3Evvs=; b=A3L9tW2aGRxwdaBGWeaMcmfsysd8TCCO1hKkmeyygmbHJQxk+3Hh21/avO+RUlmy+1 KT9//ot3S6GCQvH5xp5twdMm61Lay9rdfBNTBjORzBsIBkOUFOGw//gYs5zxpxv1dN2e x06Hft2DaM8V9sWJmNedSnQwO5nGDkaiZElTn5LUXGvK54OX6b9mq4oipVhB0f1Io+Ym 3SiIdP/oThFsxcITQ1IO5OS4L0xaBp3OzVEzaWXdtYHMPDY3l4xkmLMFVgfet5l40O/R wLBQWEVs9b0acNRpQntHOIkRpFh9nX38taa8QdfVP7Hsp7En2jh7BzB34r4tT61IU89f eMMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715341001; x=1715945801; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ouRQof1aG5mSQ/m5TMHDu/QnInDv9THxiEzJbP3Evvs=; b=bjTI8MV0Ks89E3hcYRN2asoWjdXrDGqa6rXc8k+jfFEf48QvN0vhQqVgRb+cK4UTkG 4qNLCWyZTQG8L5er1NJXsGFOLe4xMtFUCa32vnxUSvru6zpOgNehT+diNk6r49DqrMjN t3y6pPmKKY+tdukIsRJOcl/WR6rFLTQNBQsUQbU7o655gSwwr4mSbYDpJqrx75gTc2ow ON+rfbVXl+jauaDKjssAKDDDOKXoVLtSwo363A81E8bGIfzTkf/HaJc0BCLTlJj8FKLI XzG5z6mGZTZW0dq3NqvaJPodMkSQRgqO7xvU/ep0DpqVoJg3zll00xjCpAb1F0z65hKl U9Ng== X-Gm-Message-State: AOJu0YxzpdKfkRg0/JKPJ6OOn2ahorvbNyQETD2wXi7x9hw3sdco7ZUp 7BLIoesMUxwSQx7zN7xESCGkwP0xfl54RaTIjQniFCrp4GxMlyuJOMiydkOaDSTJiyn9rP5tIMD JXwwNrDZdPwuIxa15RW7gph+gUBfwcw+1sOA= X-Google-Smtp-Source: AGHT+IERhmhcPTtQdqFEBHFWKFhrz3XEGQTcX6Rk+wlxqFA7cuuVFjvwp/OVdJvN6KN4nttW5Xjy9FIeYYKwfbc65dE= X-Received: by 2002:a50:99da:0:b0:572:a731:dd16 with SMTP id 4fb4d7f45d1cf-5734d67f01amr1988547a12.28.1715341000387; Fri, 10 May 2024 04:36:40 -0700 (PDT) MIME-Version: 1.0 From: Laurent Lyaudet Date: Fri, 10 May 2024 13:36:29 +0200 Message-ID: Subject: Add an option to remove filenames for wc util To: bug-coreutils@gnu.org Content-Type: multipart/mixed; boundary="000000000000ff76b3061817f2c2" Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=laurent.lyaudet@gmail.com; helo=mail-ej1-x635.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 10 May 2024 10:30:49 -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 (--) --000000000000ff76b3061817f2c2 Content-Type: multipart/alternative; boundary="000000000000ff76b1061817f2c0" --000000000000ff76b1061817f2c0 Content-Type: text/plain; charset="UTF-8" Hello :), Thanks for your hard work :) I had a need for a variant of wordcount without filenames in the output, tuesday. https://github.com/LLyaudet/DevOrSysAdminScripts/blob/main/build_and_checks_dependencies/lines_filters.sh https://github.com/LLyaudet/DevOrSysAdminScripts/commit/f0cb3291de4ad0bc63e40baf31364d1af6849f12 I started to make a patch on GNU coreutils on that day, but I had to interrupt and continue today. Here is the patch joined to this email. Best summary of the feature is just to copy-paste my commit message: wc: Add an option -n --no-filenames. wc now has an option -n or --no-filenames to remove the filenames from the output lines. It is useful when used in conjunction with a single option -c, -m, -l, -L, or -w, since the result is a single number per line that can be easily used in shell (Bash) scripts, without having to pipe the result with cut. doc/coreutils.texi: Add option -n to documentation. NEWS: Mention the change option -n added and justify it. src/wc.c: Modify the source code to have an option -n. tests/wc/wc-no-filenames.sh: Test --no-filenames option for wc. Note that it should be a -f --filenames option if the default was different. If the default was configurable, then we should have -f --filenames -n --no-filenames options, like is possible in some of the latest versions of argparse in Python (argparse.BooleanOptionalAction). I don't know how to handle that in C code. Please accept my patch and improve upon it if needed. Best regards, Laurent Lyaudet --000000000000ff76b1061817f2c0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello :),

T= hanks for your hard work :)
I had a need for a variant of wordcou= nt without filenames in the output, tuesday.
I started to= make a patch on GNU coreutils on that day,
but I had to interrup= t and continue today.
Here is the patch joined to this email.


Best summary of the feature is just to= copy-paste my commit message:
wc: Add an option -n --no-filename= s.

wc now has an option -n or --no-filenames to remove the filenames=
from the output lines.
It is useful when used in conjunction with a = single option
-c, -m, -l, -L, or -w,
since the result is a single num= ber per line that can be easily used
in shell (Bash) scripts,
without= having to pipe the result with cut.

doc/coreutils.texi: Add option = -n to documentation.
NEWS: Mention the change option -n added and justif= y it.
src/wc.c: Modify the source code to have an option -n.
tests/wc= /wc-no-filenames.sh: Test --no-filenames option for wc.


Note that it should be a -f --filenames option if the = default was different.
If the default was configurable,
then we should have -f --filenames -n --no-filenames options,
l= ike is possible in some of the latest versions of argparse in Python=C2=A0 = (argparse.BooleanOptionalAction).
I don't know how to handle = that in C code.
Please accept my patch and improve upon it if= needed.

Best regards,
=C2=A0=C2=A0= =C2=A0=C2=A0 Laurent Lyaudet

--000000000000ff76b1061817f2c0-- --000000000000ff76b3061817f2c2 Content-Type: text/x-patch; charset="US-ASCII"; name="no_filename_option_for_wc.diff" Content-Disposition: attachment; filename="no_filename_option_for_wc.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lw0lbz6y0 RnJvbSBlZjRlODEwZDliYmQ2ZGFjNjVjMThjYjMyOGNkNWUyNGU0ODBkODVlIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMYXVyZW50IEx5YXVkZXQgPGxhdXJlbnQubHlhdWRldEBnbWFp bC5jb20+CkRhdGU6IEZyaSwgMTAgTWF5IDIwMjQgMTM6MjA6MjkgKzAyMDAKU3ViamVjdDogW1BB VENIXSB3YzogQWRkIGFuIG9wdGlvbiAtbiAtLW5vLWZpbGVuYW1lcwoKd2Mgbm93IGhhcyBhbiBv cHRpb24gLW4gb3IgLS1uby1maWxlbmFtZXMgdG8gcmVtb3ZlIHRoZSBmaWxlbmFtZXMKZnJvbSB0 aGUgb3V0cHV0IGxpbmVzLgpJdCBpcyB1c2VmdWwgd2hlbiB1c2VkIGluIGNvbmp1bmN0aW9uIHdp dGggYSBzaW5nbGUgb3B0aW9uCi1jLCAtbSwgLWwsIC1MLCBvciAtdywKc2luY2UgdGhlIHJlc3Vs dCBpcyBhIHNpbmdsZSBudW1iZXIgcGVyIGxpbmUgdGhhdCBjYW4gYmUgZWFzaWx5IHVzZWQKaW4g c2hlbGwgKEJhc2gpIHNjcmlwdHMsCndpdGhvdXQgaGF2aW5nIHRvIHBpcGUgdGhlIHJlc3VsdCB3 aXRoIGN1dC4KCmRvYy9jb3JldXRpbHMudGV4aTogQWRkIG9wdGlvbiAtbiB0byBkb2N1bWVudGF0 aW9uLgpORVdTOiBNZW50aW9uIHR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md0aCwgYnVmKSk7Ci0gIGlmIChmaWxlKQorICBp ZiAoZmlsZSAmJiBwcmludF9maWxlbmFtZXMpCiAgICAgcHJpbnRmICgiICVzIiwgc3RyY2hyIChm aWxlLCAnXG4nKSA/IHF1b3RlZiAoZmlsZSkgOiBmaWxlKTsKICAgcHV0Y2hhciAoJ1xuJyk7CiB9 CkBAIC03NDUsOSArNzQ5LDEwIEBAIG1haW4gKGludCBhcmdjLCBjaGFyICoqYXJndikKIAogICBw cmludF9saW5lcyA9IHByaW50X3dvcmRzID0gcHJpbnRfY2hhcnMgPSBwcmludF9ieXRlcyA9IGZh bHNlOwogICBwcmludF9saW5lbGVuZ3RoID0gZmFsc2U7CisgIHByaW50X2ZpbGVuYW1lcyA9IHRy dWU7CiAgIHRvdGFsX2xpbmVzID0gdG90YWxfd29yZHMgPSB0b3RhbF9jaGFycyA9IHRvdGFsX2J5 dGVzID0gbWF4X2xpbmVfbGVuZ3RoID0gMDsKIAotICB3aGlsZSAoKG9wdGMgPSBnZXRvcHRfbG9u ZyAoYXJnYywgYXJndiwgImNsTG13IiwgbG9uZ29wdHMsIG51bGxwdHIpKSAhPSAtMSkKKyAgd2hp bGUgKChvcHRjID0gZ2V0b3B0X2xvbmcgKGFyZ2MsIGFyZ3YsICJjbExtbnciLCBsb25nb3B0cywg bnVsbHB0cikpICE9IC0xKQogICAgIHN3aXRjaCAob3B0YykKICAgICAgIHsKICAgICAgIGNhc2Ug J2MnOgpAQCAtNzcwLDYgKzc3NSwxMCBAQCBtYWluIChpbnQgYXJnYywgY2hhciAqKmFyZ3YpCiAg ICAgICAgIHByaW50X2xpbmVsZW5ndGggPSB0cnVlOwogICAgICAgICBicmVhazsKIAorICAgICAg Y2FzZSAnbic6CisgICAgICAgIHByaW50X2ZpbGVuYW1lcyA9IGZhbHNlOworICAgICAgICBicmVh azsKKwogICAgICAgY2FzZSBERUJVR19QUk9HUkFNX09QVElPTjoKICAgICAgICAgZGVidWcgPSB0 cnVlOwogICAgICA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061817f2c2-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 10 12:48:30 2024 Received: (at 70860) by debbugs.gnu.org; 10 May 2024 16:48:30 +0000 Received: from localhost ([127.0.0.1]:42964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5TQ6-0004Je-Gk for submit@debbugs.gnu.org; Fri, 10 May 2024 12:48:30 -0400 Received: from mail-wm1-f44.google.com ([209.85.128.44]:49203) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5TQ4-0004JY-SB for 70860@debbugs.gnu.org; Fri, 10 May 2024 12:48:29 -0400 Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-41bca450fa3so14283835e9.2 for <70860@debbugs.gnu.org>; Fri, 10 May 2024 09:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715359644; x=1715964444; darn=debbugs.gnu.org; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject:from:to:cc :subject:date:message-id:reply-to; bh=GXDLN+6JG79FNsdcUk48NXQ6+j6IcFpnarM/7eNeOTw=; b=io2Fj/0aCcTFiO5ukmeXY4DCP6EQFGJekrqKm0Uc8Kh3HWK4xhGAVVtzftQRnQ0uPY IYIdSOeidMgTicIIj1Ge4tJz6ydasSJ3y5Y8E8pgTIfZzoTtxLNGY9e4wnKMt7+dESKD D6VMEHLH0VGFvX40LMeVhiKXQG0I1qDkitkvj6hLbH0BzOgIo0Nyq+ilU4QgSD5r6NWy TzVzIeztXf8yqJh42IvLcAzqCkg3Fbo4hZ4aUSS2YtkhrJ83kI3DEax75HfPE2yh0+k9 AKk/NNhIZbUs3qXUxe9IYcQ35ZSctHKphKcQM1Klj9Hu7HV1Vx8hr8Xsl4OayVLFBqXf rAXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715359644; x=1715964444; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GXDLN+6JG79FNsdcUk48NXQ6+j6IcFpnarM/7eNeOTw=; b=Vc74f3WpclqVURjrW+VrkTyNo3FKPej8kXoB2MGAz4ZqU5YUsMHaLdValeq9XBlG1E aiHhEgLp1T6SpIspiSRfqAZGlSz2Izz7t2VcuaL8mT+O/BOwMrKAOKLGEQWnjh8GebpP g6Mu6ab0szYlmV4N7wZbps8dDH+SDuTyBvt0giYamVhMtNe4PeluNwBsZbiwJbbsCG/M ojncGE38DboHmNZGLwsZDz3CIIFJPgVb6e2OB+WADihOsp/wi3EKHykDB43J0HEbXhak kU610x6CzTUfWSE24Xh+4yhvrB9/Mt+SB/IsBzAtROkPbA6TY+0zsGcCjuc94FEN0cm/ uSOw== X-Forwarded-Encrypted: i=1; AJvYcCW1C90sYZNe9zGBTWmiCfmsgMQR443Wl30rGJJVP8/K5QET9IFRvVZVimnMzX1EYTjp/4vC52O+Lyjieg6arMyTyREuzNc= X-Gm-Message-State: AOJu0YytiNbdFvpT9xshJ8vFbQRwfsnrWOuwJgntqC/b9S6k49P85qYO 8Nu6dEMpYCGCNELJpIilfF/7mSfpuzvz0BOWzETNHP1pEiGdwYt48bN2fg== X-Google-Smtp-Source: AGHT+IFuAPpGmWo/3v8Xq/Oto5tNaMvNSlqjpaf0y/ZG6u3bGCG9DCzks5dlFnl6IMlUIwRQgpts2w== X-Received: by 2002:a05:6000:b41:b0:34d:9c4d:e6fd with SMTP id ffacd0b85a97d-3504a61c775mr2193958f8f.4.1715359643953; Fri, 10 May 2024 09:47:23 -0700 (PDT) Received: from [192.168.23.101] (92.40.193.56.threembb.co.uk. [92.40.193.56]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3502b896a06sm5021512f8f.27.2024.05.10.09.47.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 May 2024 09:47:23 -0700 (PDT) Subject: Re: bug#70860: Add an option to remove filenames for wc util To: Laurent Lyaudet , 70860@debbugs.gnu.org References: From: Chris Elvidge Message-ID: <78f930de-f3d3-597c-48b5-34a991cf5563@gmail.com> Date: Fri, 10 May 2024 17:47:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Lightning/5.4 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Spam-Score: 1.9 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Why not use 'wc [options] Hello :), > > Thanks for your hard work :) > I had a need for a variant of wordcount without filenames in the output, > tuesday. > https://github.com/L [...] Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.5 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [92.40.193.56 listed in dnsbl.sorbs.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (celvidge001[at]gmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (celvidge001[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.44 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.44 listed in list.dnswl.org] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [92.40.193.56 listed in zen.spamhaus.org] -3.4 NICE_REPLY_A Looks like a legit reply (A) X-Debbugs-Envelope-To: 70860 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.9 (/) Why not use 'wc [options] Hello :), > > Thanks for your hard work :) > I had a need for a variant of wordcount without filenames in the output, > tuesday. > https://github.com/LLyaudet/DevOrSysAdminScripts/blob/main/build_and_checks_dependencies/lines_filters.sh > https://github.com/LLyaudet/DevOrSysAdminScripts/commit/f0cb3291de4ad0bc63e40baf31364d1af6849f12 > I started to make a patch on GNU coreutils on that day, > but I had to interrupt and continue today. > Here is the patch joined to this email. > > > Best summary of the feature is just to copy-paste my commit message: > wc: Add an option -n --no-filenames. > > wc now has an option -n or --no-filenames to remove the filenames > from the output lines. > It is useful when used in conjunction with a single option > -c, -m, -l, -L, or -w, > since the result is a single number per line that can be easily used > in shell (Bash) scripts, > without having to pipe the result with cut. > > doc/coreutils.texi: Add option -n to documentation. > NEWS: Mention the change option -n added and justify it. > src/wc.c: Modify the source code to have an option -n. > tests/wc/wc-no-filenames.sh: Test --no-filenames option for wc. > > > Note that it should be a -f --filenames option if the default was different. > If the default was configurable, > then we should have -f --filenames -n --no-filenames options, > like is possible in some of the latest versions of argparse in Python > (argparse.BooleanOptionalAction). > I don't know how to handle that in C code. > Please accept my patch and improve upon it if needed. > > Best regards, > Laurent Lyaudet > -- Chris Elvidge From debbugs-submit-bounces@debbugs.gnu.org Fri May 10 15:53:33 2024 Received: (at 70860) by debbugs.gnu.org; 10 May 2024 19:53:33 +0000 Received: from localhost ([127.0.0.1]:43800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5WJA-0001dv-HQ for submit@debbugs.gnu.org; Fri, 10 May 2024 15:53:32 -0400 Received: from mail-ej1-f49.google.com ([209.85.218.49]:49255) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5WJ8-0001dj-KZ for 70860@debbugs.gnu.org; Fri, 10 May 2024 15:53:31 -0400 Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a599a298990so588424266b.2 for <70860@debbugs.gnu.org>; Fri, 10 May 2024 12:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715370746; x=1715975546; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=j4tdZDWfOaTc56VnE3xQwKPCZVP5ashWPfjui34griA=; b=PvqYL0rnZM5r/4vfprHmstZZV111pMzYauEP3teRhKOAJK2v0U/vWJiC3UZQfO3IGq XcChsOieqv6KytHjssZmOPA5d/St5OfjEL8NQO2TImHdQ0ku24Wsdf6eOIU7vk+eGD68 LsjxdRRjZxIpvkGU3jdkoubawNti+8pixZMvwWub6S3QFIfWnv4oQiaymLT02TEQu/v/ CQCIMUoDpsqxeviD5LTYjJeqO9nA0bC+vR5ekJ2wKb5TvWqaPX961M3NsWKwdUQFHytk AvsxuUVHauhiNmhPycAIwR0G7yw42dguooNkiUraXi8BM7HJH25A7CrAK0f8I7/mNjRW 5rfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715370746; x=1715975546; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=j4tdZDWfOaTc56VnE3xQwKPCZVP5ashWPfjui34griA=; b=J7f7f7bTcbkAfwaHF4PUTcU9123g+puS9kcx1zBkfmxQJwRWIm8+XPT2NB8KZXYsk2 90rwqQ94PgpO6Bt9aMAvjlrmthETX8sgHBEGJEt/h/6MapINOAgU3vVp5ForP64syXAP xPpG7MbR3c13Gnq2jHqE8xtMcGIL/ePHMXla1ubN54jQxKBXzvKlUS/nbtHcTQt7AUup TJwNcb+oagXt2q1PBnAaILbIiOG/r3brtPB0SAsUxVsPK3q6DozhrCgB+vgse0BoOx29 wD7npydMAXqcwu76Ro79LztypbriCxz63sIaQ61UNV9ufJZ+BS+9ZYWPtOWgny9++Sh+ P7sQ== X-Gm-Message-State: AOJu0YxCyA8VRivU6U8ap4nU1eGptTKbWA86yPvCsug4uyWD5R8JYLxO l8ahfCj2f/+gaobp46sN42CmWXryolOIyfFf53u/iy/8PklX/JwfOrKriBL1QlpaBcDC1UNd2Jb XUla1lrffewds6DnWBDyb+e96wuo= X-Google-Smtp-Source: AGHT+IEcoOfE+J4ZqdiB9xz9w6LZ3x19tgGwNkZnUGQlC4Dp+PTG/s9mKvMXrLZ0bKg6utctaS12X1oBFN4YUuY4IfA= X-Received: by 2002:a50:d59d:0:b0:56d:c91c:dfc2 with SMTP id 4fb4d7f45d1cf-5734d67eca7mr2469462a12.31.1715370745671; Fri, 10 May 2024 12:52:25 -0700 (PDT) MIME-Version: 1.0 References: <78f930de-f3d3-597c-48b5-34a991cf5563@gmail.com> In-Reply-To: <78f930de-f3d3-597c-48b5-34a991cf5563@gmail.com> From: Laurent Lyaudet Date: Fri, 10 May 2024 21:52:13 +0200 Message-ID: Subject: Re: bug#70860: Add an option to remove filenames for wc util To: Chris Elvidge Content-Type: multipart/alternative; boundary="000000000000f436dc06181edfb6" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70860 Cc: 70860@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: -1.0 (-) --000000000000f436dc06181edfb6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable No, it works also with many files. Hello, Best regards, Laurent Lyaudet Le ven. 10 mai 2024, 18:47, Chris Elvidge a =C3=A9c= rit : > Why not use 'wc [options] Obv. only works on a single filename. > > On 10/05/2024 at 12:36, Laurent Lyaudet wrote: > > Hello :), > > > > Thanks for your hard work :) > > I had a need for a variant of wordcount without filenames in the output= , > > tuesday. > > > https://github.com/LLyaudet/DevOrSysAdminScripts/blob/main/build_and_chec= ks_dependencies/lines_filters.sh > > > https://github.com/LLyaudet/DevOrSysAdminScripts/commit/f0cb3291de4ad0bc6= 3e40baf31364d1af6849f12 > > I started to make a patch on GNU coreutils on that day, > > but I had to interrupt and continue today. > > Here is the patch joined to this email. > > > > > > Best summary of the feature is just to copy-paste my commit message: > > wc: Add an option -n --no-filenames. > > > > wc now has an option -n or --no-filenames to remove the filenames > > from the output lines. > > It is useful when used in conjunction with a single option > > -c, -m, -l, -L, or -w, > > since the result is a single number per line that can be easily used > > in shell (Bash) scripts, > > without having to pipe the result with cut. > > > > doc/coreutils.texi: Add option -n to documentation. > > NEWS: Mention the change option -n added and justify it. > > src/wc.c: Modify the source code to have an option -n. > > tests/wc/wc-no-filenames.sh: Test --no-filenames option for wc. > > > > > > Note that it should be a -f --filenames option if the default was > different. > > If the default was configurable, > > then we should have -f --filenames -n --no-filenames options, > > like is possible in some of the latest versions of argparse in Python > > (argparse.BooleanOptionalAction). > > I don't know how to handle that in C code. > > Please accept my patch and improve upon it if needed. > > > > Best regards, > > Laurent Lyaudet > > > > > -- > > Chris Elvidge > > > --000000000000f436dc06181edfb6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
No, it works also with many files.
Hello= ,
Best regards,
=C2=A0 =C2=A0= Laurent Lyaudet=C2=A0

Le ven. 10 mai 2024, 18:47, Chris Elvidge <= ;celvidge001@gmail.com> a = =C3=A9crit=C2=A0:
Why not use '= wc [options] <filename'
Obv. only works on a single filename.

On 10/05/2024 at 12:36, Laurent Lyaudet wrote:
> Hello :),
>
> Thanks for your hard work :)
> I had a need for a variant of wordcount without filenames in the outpu= t,
> tuesday.
> https://github.com/LLyaudet/DevOrSysAdminScripts/blob/= main/build_and_checks_dependencies/lines_filters.sh
> https://github.com/LLyaudet/DevOrSysAdminScripts/commit/f0cb329= 1de4ad0bc63e40baf31364d1af6849f12
> I started to make a patch on GNU coreutils on that day,
> but I had to interrupt and continue today.
> Here is the patch joined to this email.
>
>
> Best summary of the feature is just to copy-paste my commit message: > wc: Add an option -n --no-filenames.
>
> wc now has an option -n or --no-filenames to remove the filenames
> from the output lines.
> It is useful when used in conjunction with a single option
> -c, -m, -l, -L, or -w,
> since the result is a single number per line that can be easily used > in shell (Bash) scripts,
> without having to pipe the result with cut.
>
> doc/coreutils.texi: Add option -n to documentation.
> NEWS: Mention the change option -n added and justify it.
> src/wc.c: Modify the source code to have an option -n.
> tests/wc/wc-no-filenames.sh: Test --no-filenames option for wc.
>
>
> Note that it should be a -f --filenames option if the default was diff= erent.
> If the default was configurable,
> then we should have -f --filenames -n --no-filenames options,
> like is possible in some of the latest versions of argparse in Python<= br> > (argparse.BooleanOptionalAction).
> I don't know how to handle that in C code.
> Please accept my patch and improve upon it if needed.
>
> Best regards,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0Laurent Lyaudet
>


--

Chris Elvidge


--000000000000f436dc06181edfb6-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 10 15:54:24 2024 Received: (at 70860) by debbugs.gnu.org; 10 May 2024 19:54:24 +0000 Received: from localhost ([127.0.0.1]:43807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5WK0-0001f2-54 for submit@debbugs.gnu.org; Fri, 10 May 2024 15:54:24 -0400 Received: from mail-lf1-f49.google.com ([209.85.167.49]:55603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5WJz-0001ev-5B for 70860@debbugs.gnu.org; Fri, 10 May 2024 15:54:23 -0400 Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-51aa6a8e49aso3060162e87.3 for <70860@debbugs.gnu.org>; Fri, 10 May 2024 12:54:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715370798; x=1715975598; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=VlQgW9UMat17vJYZvHDZlBVXXIwoaMp/RF3F4PnK9T0=; b=Oj/BcklVXznmbcVVUBX1ep87zvcYsjZrBMvX0gWD2SzN/jy2vhmuOXeZheQgm+k6ty wWnX5+vUklHzMggssEr9jAOxrvIjWbV1Ba0r/3JLOq09fo7LharCKH+dG4+KwXQsmCAv IrCItssBXYHZX+63y44i89uPAogvneyuLfHr+f30MxP7gVtImSSdugIEyMxKqtDPS1Ds 7KOUjeDfRpW1USryRwj4Mx3RP5EurpGf6oEZ8EMRTjYpSfc0eQy99sZGcz47Qbg8RXNK NwpINk6W6Oz43/1UN+gg8b35G7GmNKQSYBL1TYpSZVtSSMpdFkMvg7q3TjtXiiYhdhap Bzlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715370798; x=1715975598; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VlQgW9UMat17vJYZvHDZlBVXXIwoaMp/RF3F4PnK9T0=; b=wi614W1QH1Py7X2ykmV+4dWgVGgFt75XJiaTjj1eA3JOutfK8M/JD++p8SdSf4AFjQ N/LK2K164GQWEN5/o9GP3/yKzzrPg9SuBZG7HyTY8qmtdxISoiIy66115CF89R8GSMUP GId3DhNfv9VkNFy8tbY1/UfPExa1o3oOEbxgpQeRPJZBP6/Yk15NDVX2KEHmHu+yaQn8 bXVDWPVca/oM/1Pk0WCBrhu9GGLq1/DGlmBWwDahZdque04Wl1b3xoCmwzzKuiSkSRhf HWQ3KV6MqZ0m0AAWBQFIy15xucXbh56Iefx1lvsmHpNqV3dmq770Mhl1HXN4g+9roJNF 3xPA== X-Gm-Message-State: AOJu0Yxsfnr/laVL/Dnp5XAwTu4JBV+MvMc4eRwXMQ8rkjmKQPn8+ROk D3+76yKXZ3uQCiEcN3GrdQOaTXsGcPpCR2zTCw1FLGqqrzW3ah9ALa4ESp8FN6GocJObfyo9b39 w5zTH0vq9r8/x7K60G9oxKzp6/ek= X-Google-Smtp-Source: AGHT+IGpqPuz31EsxKOy03UQUPGsxHLmr1YU4vSpSX2qe8TiKyO8IkwYZY6F4gY4lrMVA8Ql952A/XWaGCDYqNARuo4= X-Received: by 2002:a05:6512:1094:b0:51d:1830:8380 with SMTP id 2adb3069b0e04-5220fa71925mr2848309e87.8.1715370797943; Fri, 10 May 2024 12:53:17 -0700 (PDT) MIME-Version: 1.0 References: <78f930de-f3d3-597c-48b5-34a991cf5563@gmail.com> In-Reply-To: From: Laurent Lyaudet Date: Fri, 10 May 2024 21:53:05 +0200 Message-ID: Subject: Re: bug#70860: Add an option to remove filenames for wc util To: Chris Elvidge Content-Type: multipart/alternative; boundary="00000000000011d66a06181ee3a3" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70860 Cc: 70860@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: -1.0 (-) --00000000000011d66a06181ee3a3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Pro-tip use globbing. Le ven. 10 mai 2024, 21:52, Laurent Lyaudet a =C3=A9crit : > No, it works also with many files. > Hello, > Best regards, > Laurent Lyaudet > > Le ven. 10 mai 2024, 18:47, Chris Elvidge a > =C3=A9crit : > >> Why not use 'wc [options] > Obv. only works on a single filename. >> >> On 10/05/2024 at 12:36, Laurent Lyaudet wrote: >> > Hello :), >> > >> > Thanks for your hard work :) >> > I had a need for a variant of wordcount without filenames in the outpu= t, >> > tuesday. >> > >> https://github.com/LLyaudet/DevOrSysAdminScripts/blob/main/build_and_che= cks_dependencies/lines_filters.sh >> > >> https://github.com/LLyaudet/DevOrSysAdminScripts/commit/f0cb3291de4ad0bc= 63e40baf31364d1af6849f12 >> > I started to make a patch on GNU coreutils on that day, >> > but I had to interrupt and continue today. >> > Here is the patch joined to this email. >> > >> > >> > Best summary of the feature is just to copy-paste my commit message: >> > wc: Add an option -n --no-filenames. >> > >> > wc now has an option -n or --no-filenames to remove the filenames >> > from the output lines. >> > It is useful when used in conjunction with a single option >> > -c, -m, -l, -L, or -w, >> > since the result is a single number per line that can be easily used >> > in shell (Bash) scripts, >> > without having to pipe the result with cut. >> > >> > doc/coreutils.texi: Add option -n to documentation. >> > NEWS: Mention the change option -n added and justify it. >> > src/wc.c: Modify the source code to have an option -n. >> > tests/wc/wc-no-filenames.sh: Test --no-filenames option for wc. >> > >> > >> > Note that it should be a -f --filenames option if the default was >> different. >> > If the default was configurable, >> > then we should have -f --filenames -n --no-filenames options, >> > like is possible in some of the latest versions of argparse in Python >> > (argparse.BooleanOptionalAction). >> > I don't know how to handle that in C code. >> > Please accept my patch and improve upon it if needed. >> > >> > Best regards, >> > Laurent Lyaudet >> > >> >> >> -- >> >> Chris Elvidge >> >> >> --00000000000011d66a06181ee3a3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Pro-tip use globbing.

Le ven. 10 mai 2024, 21:52, Laurent = Lyaudet <laurent.lyaudet@gm= ail.com> a =C3=A9crit=C2=A0:
No, it works also with many files.
Hell= o,
Best regards,
=C2=A0 =C2= =A0 Laurent Lyaudet=C2=A0

Le ven. 10 mai 2024, 18:47, Chris Elvidge &l= t;celvidge001@gmail.com> a =C3=A9crit=C2=A0:
Why not use 'wc [options] <filename'
Obv. only works on a single filename.

On 10/05/2024 at 12:36, Laurent Lyaudet wrote:
> Hello :),
>
> Thanks for your hard work :)
> I had a need for a variant of wordcount without filenames in the outpu= t,
> tuesday.
> https://github.com/LLyaudet/DevOrSysAdminSc= ripts/blob/main/build_and_checks_dependencies/lines_filters.sh
> https://github.com/LLyaudet/DevOrSysAdminScripts/com= mit/f0cb3291de4ad0bc63e40baf31364d1af6849f12
> I started to make a patch on GNU coreutils on that day,
> but I had to interrupt and continue today.
> Here is the patch joined to this email.
>
>
> Best summary of the feature is just to copy-paste my commit message: > wc: Add an option -n --no-filenames.
>
> wc now has an option -n or --no-filenames to remove the filenames
> from the output lines.
> It is useful when used in conjunction with a single option
> -c, -m, -l, -L, or -w,
> since the result is a single number per line that can be easily used > in shell (Bash) scripts,
> without having to pipe the result with cut.
>
> doc/coreutils.texi: Add option -n to documentation.
> NEWS: Mention the change option -n added and justify it.
> src/wc.c: Modify the source code to have an option -n.
> tests/wc/wc-no-filenames.sh: Test --no-filenames option for wc.
>
>
> Note that it should be a -f --filenames option if the default was diff= erent.
> If the default was configurable,
> then we should have -f --filenames -n --no-filenames options,
> like is possible in some of the latest versions of argparse in Python<= br> > (argparse.BooleanOptionalAction).
> I don't know how to handle that in C code.
> Please accept my patch and improve upon it if needed.
>
> Best regards,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0Laurent Lyaudet
>


--

Chris Elvidge


--00000000000011d66a06181ee3a3-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 10 17:35:27 2024 Received: (at 70860) by debbugs.gnu.org; 10 May 2024 21:35:27 +0000 Received: from localhost ([127.0.0.1]:44244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5Xtm-0002m7-Td for submit@debbugs.gnu.org; Fri, 10 May 2024 17:35:27 -0400 Received: from mail-wr1-f54.google.com ([209.85.221.54]:51388) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5Xtk-0002m1-6j for 70860@debbugs.gnu.org; Fri, 10 May 2024 17:35:24 -0400 Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-34e28e32ea4so1483439f8f.2 for <70860@debbugs.gnu.org>; Fri, 10 May 2024 14:35:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715376859; x=1715981659; darn=debbugs.gnu.org; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject:from:to:cc :subject:date:message-id:reply-to; bh=RHB1VEwHD0E0FxKs68w+4pmx3msKTNJglFFUoXMEVAs=; b=JJEtQzFvKRvLfIy3q0T8zTvU5tJiMUs8zV+fQe5U1iGyveggz1ul4wN+K+B3J0LBUt 7mwhTL4i4P+8QjLTFQE85/GrmL21fC14rPlwgV4vq9se/OcOz0twD4xz9dZpzL3hsmYK xdlyvF1ye8RTkRQT7O9ee7i7aHJAQ/RssZ/EGtPMNYJ05UmtmyVy/HueBkGAHRc2lUcW FvEd8SLLw8+kyYWaOP+3bQ6/8H0PYXBilRrsyEpC5/x0Vobragl+Nivmam5mz1kkI0li rlxSVbTO1NATDIFFJD5Wil9hhKUVIivRGyF8JgLf3QZvZE49dlBtX6LFAtflKPsk6ay6 BwMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715376859; x=1715981659; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RHB1VEwHD0E0FxKs68w+4pmx3msKTNJglFFUoXMEVAs=; b=KzG8icqaofdzeDPSmc0y/3bm8DuVoZMxRvQUlyMOkPWQXYvgu3L7LvJ4RBmizca/JM IzMJ8DV9QbL71JAL+aHN20DYxB79FKydyle+HiUqQ07+UmATclDVywPv1ziVPiKJSxJ+ df8LiFEhfOuUP0F1e3RRY7XLe1OsTYoRHG44huyIzwUTE+dUXT1UrtRVwrlVMgFOxM29 mwf/l93YNgZZrrnKIGL6idbCxhJcwVT1gDOb5CamQAP2efucaEnebKLxGwvpmNW2Rtol 6dZlmNiu4T6hWWO3zviB7ZFMBA6+3F7WlOA/l1Ri2ouXozZw6ZhDYIxA2kHkFhUsuThA EZfQ== X-Gm-Message-State: AOJu0YwrJg5nwSb0wH7rTa0oSQ4dfJRSX4CZ8JBXC3U83pElLq4pq7th Jo731QvKxCwJsS7ChCkjYHHcQ17GXtGe1ppBzLNycHnHmFhSFTVSRt/L5Q== X-Google-Smtp-Source: AGHT+IHFkiVpLNCsVybqV+z940FhfFTrvvSmG3CfORuACIXKu+DkfGkgk2XMTOtWzWeBM5Hae/qnqw== X-Received: by 2002:a5d:698d:0:b0:34d:354:b9ba with SMTP id ffacd0b85a97d-3504a73e32dmr2884080f8f.30.1715376859116; Fri, 10 May 2024 14:34:19 -0700 (PDT) Received: from [192.168.23.101] (92.40.216.255.threembb.co.uk. [92.40.216.255]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35045583669sm3848331f8f.106.2024.05.10.14.34.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 May 2024 14:34:18 -0700 (PDT) Subject: Re: bug#70860: Add an option to remove filenames for wc util To: Laurent Lyaudet References: <78f930de-f3d3-597c-48b5-34a991cf5563@gmail.com> From: Chris Elvidge Message-ID: <97450d0d-cdc5-5767-5538-c009a15c5834@gmail.com> Date: Fri, 10 May 2024 22:34:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Lightning/5.4 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: 70860 Cc: 70860@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: -0.6 (/) Yes, but if you do it ( No, it works also with many files. > Hello, > Best regards, > Laurent Lyaudet > > Le ven. 10 mai 2024, 18:47, Chris Elvidge > a écrit : > > Why not use 'wc [options] Obv. only works on a single filename. > > On 10/05/2024 at 12:36, Laurent Lyaudet wrote: > > Hello :), > > > > Thanks for your hard work :) > > I had a need for a variant of wordcount without filenames in the > output, > > tuesday. > > > https://github.com/LLyaudet/DevOrSysAdminScripts/blob/main/build_and_checks_dependencies/lines_filters.sh > > > https://github.com/LLyaudet/DevOrSysAdminScripts/commit/f0cb3291de4ad0bc63e40baf31364d1af6849f12 > > I started to make a patch on GNU coreutils on that day, > > but I had to interrupt and continue today. > > Here is the patch joined to this email. > > > > > > Best summary of the feature is just to copy-paste my commit message: > > wc: Add an option -n --no-filenames. > > > > wc now has an option -n or --no-filenames to remove the filenames > > from the output lines. > > It is useful when used in conjunction with a single option > > -c, -m, -l, -L, or -w, > > since the result is a single number per line that can be easily used > > in shell (Bash) scripts, > > without having to pipe the result with cut. > > > > doc/coreutils.texi: Add option -n to documentation. > > NEWS: Mention the change option -n added and justify it. > > src/wc.c: Modify the source code to have an option -n. > > tests/wc/wc-no-filenames.sh: Test --no-filenames option for wc. > > > > > > Note that it should be a -f --filenames option if the default was > different. > > If the default was configurable, > > then we should have -f --filenames -n --no-filenames options, > > like is possible in some of the latest versions of argparse in Python > > (argparse.BooleanOptionalAction). > > I don't know how to handle that in C code. > > Please accept my patch and improve upon it if needed. > > > > Best regards, > > Laurent Lyaudet > > > > > -- > > Chris Elvidge > > -- Chris Elvidge