From unknown Thu Aug 14 18:33:43 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#13897 <13897@debbugs.gnu.org> To: bug#13897 <13897@debbugs.gnu.org> Subject: Status: Linux command - wc Reply-To: bug#13897 <13897@debbugs.gnu.org> Date: Fri, 15 Aug 2025 01:33:43 +0000 retitle 13897 Linux command - wc reassign 13897 coreutils submitter 13897 Francisco Jos=C3=A9 Tena severity 13897 normal tag 13897 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 07 11:55:14 2013 Received: (at submit) by debbugs.gnu.org; 7 Mar 2013 16:55:14 +0000 Received: from localhost ([127.0.0.1]:36797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDe65-0005Sm-3K for submit@debbugs.gnu.org; Thu, 07 Mar 2013 11:55:13 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56068) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDZB2-0005dK-1T for submit@debbugs.gnu.org; Thu, 07 Mar 2013 06:40:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDZAN-0003C1-2g for submit@debbugs.gnu.org; Thu, 07 Mar 2013 06:39:23 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:49318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDZAM-0003Bx-UX for submit@debbugs.gnu.org; Thu, 07 Mar 2013 06:39:18 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDZAH-0001G1-Sf for bug-coreutils@gnu.org; Thu, 07 Mar 2013 06:39:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDZA9-00039G-NE for bug-coreutils@gnu.org; Thu, 07 Mar 2013 06:39:13 -0500 Received: from mail-ia0-x22e.google.com ([2607:f8b0:4001:c02::22e]:61836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDZA9-000399-Ho for bug-coreutils@gnu.org; Thu, 07 Mar 2013 06:39:05 -0500 Received: by mail-ia0-f174.google.com with SMTP id u20so304736iag.19 for ; Thu, 07 Mar 2013 03:39:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:from:date:x-google-sender-auth :message-id:subject:to:content-type; bh=3EHK6gV4+Itbn3g5u8z0GAcAazc0KddDbssK6iAHOvU=; b=fq2iGj4sUxNhnWADmqq3gqsY6o583+Nq5IfuyvCrrpjHeka35l+fVDnWpQMy84Nsv7 e9CF7eqIFfIEdrTtf31dyVDhHavSTI47CuHyvQuoDFLgJGTrbu25xSNRSMa46vPKfg1Q OnIdNY7AOYaY96KnoEFCKKIOZ9xPztPeCUu17oh4K1Asg//9DLCCPHEtd19uc2vipzvZ bTn+m5JKh4xs3p+QsW6et1Ekkimgdiebx1D+BD+POc2xSNR8+RRUsIeDeFLZU5mTEn7F 48KT2mHT/nzfMefyytkr1UJhQv8DAJZ7/lc+bAV18eCrXe+RmQoFdyUpwhyqKjiWlj5v a5Xw== X-Received: by 10.50.173.105 with SMTP id bj9mr14310738igc.44.1362656344573; Thu, 07 Mar 2013 03:39:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.110.136 with HTTP; Thu, 7 Mar 2013 03:38:44 -0800 (PST) From: =?ISO-8859-1?Q?Francisco_Jos=E9_Tena?= Date: Thu, 7 Mar 2013 12:38:44 +0100 X-Google-Sender-Auth: d3jQ2XMCezqQ6fssmpPR55merb4 Message-ID: Subject: Linux command - wc To: bug-coreutils@gnu.org Content-Type: multipart/alternative; boundary=e89a8f83a6055e8c6c04d754277f X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 07 Mar 2013 11:55:11 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) --e89a8f83a6055e8c6c04d754277f Content-Type: text/plain; charset=ISO-8859-1 Hello, Using wc command in Linux, we're getting an unexpected behaviour. The next command is returning 5 chars: $ echo "TEST" | wc -m The same behaviour is returned using the following command: $ echo "TEST" | wc -c Put the text in a file doesn't change the result. If we type, $ echo "TEST" | wc -L the result is 4. What the hell is happening? Thanks, Francisco Tena. --e89a8f83a6055e8c6c04d754277f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello,
=A0
Using wc command in Linux, we're getting an unexpected behaviour.<= /div>
=A0
The next command is returning=A05 chars:
=A0
$ echo "TEST" | wc -m
=A0
The same behaviour is returned using the following command:
=A0
$ echo "TEST" | wc -c
=A0
Put the text in a file doesn't change the result.
=A0
If we type,
=A0
$ echo "TEST" | wc -L
the result is 4.
=A0
What the hell is happening?
=A0
Thanks,
=A0
Francisco Tena.
--e89a8f83a6055e8c6c04d754277f-- From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 07 12:55:03 2013 Received: (at 13897-done) by debbugs.gnu.org; 7 Mar 2013 17:55:03 +0000 Received: from localhost ([127.0.0.1]:36859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDf1z-0006qd-0e for submit@debbugs.gnu.org; Thu, 07 Mar 2013 12:55:03 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:57676) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDf1x-0006qA-9A for 13897-done@debbugs.gnu.org; Thu, 07 Mar 2013 12:55:02 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 32FEBA60002; Thu, 7 Mar 2013 09:54:23 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z3ymZ10GDhfx; Thu, 7 Mar 2013 09:54:22 -0800 (PST) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id DBE74A60001; Thu, 7 Mar 2013 09:54:22 -0800 (PST) Message-ID: <5138D44E.5030202@cs.ucla.edu> Date: Thu, 07 Mar 2013 09:54:22 -0800 From: Paul Eggert User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130219 Thunderbird/17.0.3 MIME-Version: 1.0 To: =?UTF-8?B?RnJhbmNpc2NvIEpvc8OpIFRlbmE=?= Subject: Re: bug#13897: Linux command - wc References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 13897-done Cc: 13897-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) On 03/07/13 03:38, Francisco Jos=C3=A9 Tena wrote: > The next command is returning 5 chars: >=20 > $ echo "TEST" | wc -m Tha's correct, since the 'echo' is outputting 5 characters: T, E, S, T, and newline. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 07 13:43:16 2013 Received: (at 13897) by debbugs.gnu.org; 7 Mar 2013 18:43:16 +0000 Received: from localhost ([127.0.0.1]:36935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDfme-0007wk-4T for submit@debbugs.gnu.org; Thu, 07 Mar 2013 13:43:16 -0500 Received: from joseki.proulx.com ([216.17.153.58]:48423) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDfmb-0007wc-HW for 13897@debbugs.gnu.org; Thu, 07 Mar 2013 13:43:14 -0500 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 48736211D5; Thu, 7 Mar 2013 11:42:39 -0700 (MST) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 29D032DC96; Thu, 7 Mar 2013 11:42:39 -0700 (MST) Date: Thu, 7 Mar 2013 11:42:39 -0700 From: Bob Proulx To: 13897@debbugs.gnu.org, tarod.net@gmail.com Subject: Re: bug#13897: Linux command - wc Message-ID: <20130307184239.GA15987@hysteria.proulx.com> References: <5138D44E.5030202@cs.ucla.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <5138D44E.5030202@cs.ucla.edu> User-Agent: Mutt/1.5.21 (2010-09-15) Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 13897 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.6 (/) Paul Eggert wrote: > On 03/07/13 03:38, Francisco Jos=E9 Tena wrote: > > The next command is returning 5 chars: > >=20 > > $ echo "TEST" | wc -m >=20 > Tha's correct, since the 'echo' is outputting 5 characters: > T, E, S, T, and newline. See also the output from od. $ echo "TEST" | od -tx1 -c 0000000 54 45 53 54 0a T E S T \n Bob From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 07 14:39:01 2013 Received: (at 13897) by debbugs.gnu.org; 7 Mar 2013 19:39:01 +0000 Received: from localhost ([127.0.0.1]:37039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDgea-0000om-1J for submit@debbugs.gnu.org; Thu, 07 Mar 2013 14:39:01 -0500 Received: from mail-ia0-f181.google.com ([209.85.210.181]:40773) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDgL8-0000K1-RQ for 13897@debbugs.gnu.org; Thu, 07 Mar 2013 14:18:55 -0500 Received: by mail-ia0-f181.google.com with SMTP id w33so749262iag.12 for <13897@debbugs.gnu.org>; Thu, 07 Mar 2013 11:18:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=TMkwTH49FlmxVDgN4741s+F1PEFutmM5s2+yQMRSO/U=; b=hvaKUYq1wzv5+5ok5cgEfAiNrUVg8luobI3SpcOavxy3W9/TBD53Hn5F1eXRaPFYSS VaOSkT7HOtL36nXD6sHQPnYghlDUCKdi9qrrRVW89aLj3Rrsa2vsnK/l8xq4c5sT7wGf g4MyKdsAHyGD1TVgEgX/yTia6GoQuUTd/V9RCT6vTGEzeAX+3KkyQa3tCPh+qryjzeKj qY++yWwGHduG36+1uAQZSHUPbi/ScYW5ZweKM5KwTJzwI2JlYXYqJLMEIvIl20XPYw/M 6Uskc7fIaRQsjeop6uh5zBj5T/H9zgDun5jO0Jf47hKrvnBU7Q75v4uIgum5X0S4wPD4 3C6Q== X-Received: by 10.50.185.137 with SMTP id fc9mr15437265igc.109.1362683895176; Thu, 07 Mar 2013 11:18:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.110.136 with HTTP; Thu, 7 Mar 2013 11:17:55 -0800 (PST) In-Reply-To: <20130307184239.GA15987@hysteria.proulx.com> References: <5138D44E.5030202@cs.ucla.edu> <20130307184239.GA15987@hysteria.proulx.com> From: =?ISO-8859-1?Q?Francisco_Jos=E9_Tena?= Date: Thu, 7 Mar 2013 20:17:55 +0100 X-Google-Sender-Auth: A16d1r6dBiz5l2jyCduC7jpPK_Q Message-ID: Subject: Re: bug#13897: Linux command - wc To: Bob Proulx Content-Type: multipart/alternative; boundary=14dae9340bff85412d04d75a9109 X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13897 X-Mailman-Approved-At: Thu, 07 Mar 2013 14:38:59 -0500 Cc: 13897@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) --14dae9340bff85412d04d75a9109 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thank you very much. On Thu, Mar 7, 2013 at 7:42 PM, Bob Proulx wrote: > Paul Eggert wrote: > > On 03/07/13 03:38, Francisco Jos=E9 Tena wrote: > > > The next command is returning 5 chars: > > > > > > $ echo "TEST" | wc -m > > > > Tha's correct, since the 'echo' is outputting 5 characters: > > T, E, S, T, and newline. > > See also the output from od. > > $ echo "TEST" | od -tx1 -c > 0000000 54 45 53 54 0a > T E S T \n > > Bob > --14dae9340bff85412d04d75a9109 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thank you very much.


On Thu, Mar 7, 2013 at 7:42 PM, Bob Proulx <bob@proul= x.com> wrote:
Paul= Eggert wrote:
> On 03/07/13 03:38, Francisco Jos=E9 Tena wrote:
> > The next command is returning 5 chars:
> >
> > $ echo "TEST" | wc -m
>
> Tha's correct, since the 'echo' is outputting 5 characters= :
> T, E, S, T, and newline.

See also the output from od.

=A0 $ echo "TEST" | od -tx1 -c
=A0 0000000 =A054 =A045 =A053 =A054 =A00a
=A0 =A0 =A0 =A0 =A0 =A0 T =A0 E =A0 S =A0 T =A0\n

Bob

--14dae9340bff85412d04d75a9109-- From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 07 18:07:15 2013 Received: (at control) by debbugs.gnu.org; 7 Mar 2013 23:07:15 +0000 Received: from localhost ([127.0.0.1]:37339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDju6-0007LI-2n for submit@debbugs.gnu.org; Thu, 07 Mar 2013 18:07:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34266) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDjtn-0007Kd-Qq for control@debbugs.gnu.org; Thu, 07 Mar 2013 18:07:12 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r27N6Knu004557 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 7 Mar 2013 18:06:21 -0500 Received: from [10.36.116.31] (ovpn-116-31.ams2.redhat.com [10.36.116.31]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r27N6INd014469 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Thu, 7 Mar 2013 18:06:20 -0500 Message-ID: <51391D6A.9030407@draigBrady.com> Date: Thu, 07 Mar 2013 23:06:18 +0000 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: control@debbugs.gnu.org X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) tag 13897 notabug close 13897 tag 13899 notabug close 13899 stop From unknown Thu Aug 14 18:33:43 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, 05 Apr 2013 11:24:03 +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