From unknown Fri Jun 13 09:56:57 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#24054 <24054@debbugs.gnu.org> To: bug#24054 <24054@debbugs.gnu.org> Subject: Status: tr bug? [:space:] acts like "a" Reply-To: bug#24054 <24054@debbugs.gnu.org> Date: Fri, 13 Jun 2025 16:56:57 +0000 retitle 24054 tr bug? [:space:] acts like "a" reassign 24054 coreutils submitter 24054 severity 24054 normal tag 24054 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 22 16:19:19 2016 Received: (at submit) by debbugs.gnu.org; 22 Jul 2016 20:19:19 +0000 Received: from localhost ([127.0.0.1]:34016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQguk-0005Lc-65 for submit@debbugs.gnu.org; Fri, 22 Jul 2016 16:19:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQff2-0003ML-4J for submit@debbugs.gnu.org; Fri, 22 Jul 2016 14:59:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQfew-0006S0-4f for submit@debbugs.gnu.org; Fri, 22 Jul 2016 14:58:55 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQfew-0006Rv-1W for submit@debbugs.gnu.org; Fri, 22 Jul 2016 14:58:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQfet-0001dX-N8 for bug-coreutils@gnu.org; Fri, 22 Jul 2016 14:58:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQfeo-0006PL-MB for bug-coreutils@gnu.org; Fri, 22 Jul 2016 14:58:51 -0400 Received: from w1.tutanota.de ([81.3.6.162]:38487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQfeo-0006OX-Eb for bug-coreutils@gnu.org; Fri, 22 Jul 2016 14:58:46 -0400 Received: from localhost (unknown [127.0.0.1]) by w1.tutanota.de (Postfix) with ESMTP id 787D8FA8A1A for ; Fri, 22 Jul 2016 18:58:43 +0000 (UTC) Received: from w1.tutanota.de ([127.0.0.1]) by localhost (w1.tutanota.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OKkCT8nuXLh7 for ; Fri, 22 Jul 2016 18:58:43 +0000 (UTC) Received: from w1.tutanota.de (unknown [127.0.0.1]) by w1.tutanota.de (Postfix) with ESMTP id 1792BFA89A8 for ; Fri, 22 Jul 2016 18:58:43 +0000 (UTC) Date: Fri, 22 Jul 2016 19:58:43 +0100 (BST) From: To: Message-ID: Subject: tr bug? [:space:] acts like "a" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_46495_596569688.1469213923082" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 22 Jul 2016 16:19: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: -4.1 (----) ------=_Part_46495_596569688.1469213923082 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit For the last few weeks tr [:space:] isn't working the way it used to for me under Ubuntu 14.04. Instead of acting on spaces it acts on "a"s.: me@U:~$ echo "thisstring abcde what the heck?" | tr [:space:] '_' thisstring _bcde wh_t the heck? me@U:~$ This is 64 bit 14.04 built up from the mini.iso with just plain Openbox as the only DE, in lxterminal using bash. -- Securely sent with Tutanota. Claim your encrypted mailbox today! https://tutanota.com ------=_Part_46495_596569688.1469213923082 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit For the last few weeks tr [:space:] isn't working the way it used to for me under Ubuntu 14.04. Instead of acting on spaces it acts on "a"s.:

me@U:~$ echo "thisstring abcde what the heck?" | tr [:space:] '_'
thisstring _bcde wh_t the heck?
me@U:~$

This is 64 bit 14.04 built up from the mini.iso with just plain Openbox as the only DE, in lxterminal using bash.



--
Securely sent with Tutanota. Claim your encrypted mailbox today!
https://tutanota.com ------=_Part_46495_596569688.1469213923082-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 22 17:18:36 2016 Received: (at 24054) by debbugs.gnu.org; 22 Jul 2016 21:18:36 +0000 Received: from localhost ([127.0.0.1]:34047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQhq7-0006l1-Ve for submit@debbugs.gnu.org; Fri, 22 Jul 2016 17:18:36 -0400 Received: from mail-qk0-f178.google.com ([209.85.220.178]:33206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQhq6-0006kp-Gd for 24054@debbugs.gnu.org; Fri, 22 Jul 2016 17:18:35 -0400 Received: by mail-qk0-f178.google.com with SMTP id p74so112414055qka.0 for <24054@debbugs.gnu.org>; Fri, 22 Jul 2016 14:18:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=43QR2PrOj/b9l2W00Ux4gBMEe1gQRbcjSUK906JJU8Q=; b=sR2X6jmx0XiGKWrZoWH8fEZINBIlY91nL0XjNzqb+LlBhk8zuDLbKq8dXCiIWt7cB1 TX6JfMaXsCL7TtcdnIHb9gMObzxe58um7n7JNPqV75TGfG7k4c2FFWIbTMrQruB2ZU46 JbbUdJzSivNUeEZ061f2dx0+vK2USr602hWlcFeiwTIva6FNJXrNEAXjwHyMCiSgpL7z 8/0OEmovxNyiawgn1lWaCReL3C531EHTFaUxb9XErYJ0eChLvERtO7Uy4WintbqHgSwQ w+920vcMqywLW6yZ/BNKK/YDpaSFEplfnsWNcOPgma+Vyw7LKyreSd+3On7vOj01WFEM B6Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=43QR2PrOj/b9l2W00Ux4gBMEe1gQRbcjSUK906JJU8Q=; b=HU/BIW+Z5PGxSJ8kz+mNBTOdyIX2yUFUbg7wEsgpUzUHDoKyzsBgGAvolh2lTBQI0M pZ3pFNbk82l9T3FPN3D5qg762Skie3wi+QymmZfleiWw+2MRYAOvJASHWybue7Fjkqxc TZR3BCR0DLvKKGPiFCK6+8aW/DFzMI9UkuczLigGmIVlM2Vr6JO9gjfmSM/Bzx6V5kQ7 gOGtTAca28dPzLUVjmqWEjNiN30tfRIGvRbszGarLDmsGg0Kl3g7y7xonHqyA0BVC9Va mD7u7zTTx4VE1cO5SWxpUTz+oxUUZMjKlFymTq/78EaBSxYPCCZ8ppC0bNVJFLpeEwE4 hieQ== X-Gm-Message-State: AEkoouvN571p/8DlcOfaraTtZjEnZ3Tqyveq4J/0eltxG0uUeM8zI8lqYz5/YfUCUcs68g== X-Received: by 10.55.153.70 with SMTP id b67mr7452528qke.190.1469222309092; Fri, 22 Jul 2016 14:18:29 -0700 (PDT) Received: from disco.erlich.nygenome.org ([69.74.14.178]) by smtp.googlemail.com with ESMTPSA id d85sm8379076qkg.47.2016.07.22.14.18.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jul 2016 14:18:28 -0700 (PDT) Subject: Re: bug#24054: tr bug? [:space:] acts like "a" To: pmun@tutanota.de, 24054@debbugs.gnu.org References: From: Assaf Gordon Message-ID: <083c897c-3cac-de5e-45c1-26988490f5aa@gmail.com> Date: Fri, 22 Jul 2016 17:18:27 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 24054 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.7 (/) tag 24054 notabug close 24045 stop Hello, On 07/22/2016 02:58 PM, pmun@tutanota.de wrote: > For the last few weeks tr [:space:] isn't working the way it used to for me under Ubuntu 14.04. Instead of acting on spaces it acts on "a"s.: > > me@U:~$ echo "thisstring abcde what the heck?" | tr [:space:] '_' > thisstring _bcde wh_t the heck? > > This is 64 bit 14.04 built up from the mini.iso with just plain Openbox as the only DE, in lxterminal using bash. This is not a bug, but a result of your shell (bash) performing filename completion on single-letter filenames in your current directory. In bash, the syntax [X] without quotes does filename completion, just like "*" or "?". I would guess that in the last few weeks you created a file called 'a' in the directory, and so '[:space:]' matched it (technically it means: match filenames of one character, one of :,s,p,a,c or e). It used to "just work", because if the shell does not find matching files, it passes the parameter as-is to the program. The following will demonstrate: $ mkdir empty $ cd empty $ echo [:space:] [:space:] $ touch a $ echo [:space:] a $ touch ':' $ echo [:space:] : a $ echo '[:space:]' [:space:] Since the shell replaced '[:space:]' with 'a', the 'tr' command became: tr a '_' which is the behavior you encountered. The solution is to always quote such parameters: $ echo "thisstring abcde what the heck?" | tr '[:space:]' '_' thisstring_abcde_what_the_heck?_ (The last underscore is the newline, which also counts as whitespace). To learn more about bash's filename expansion capabilities, see here: https://www.gnu.org/software/bash/manual/bashref.html#Filename-Expansion As such I'm closing this bug report, but discussion can continue by replying to this thread. regards, - assaf From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 22 19:00:54 2016 Received: (at control) by debbugs.gnu.org; 22 Jul 2016 23:00:54 +0000 Received: from localhost ([127.0.0.1]:34088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQjR8-0000lr-6J for submit@debbugs.gnu.org; Fri, 22 Jul 2016 19:00:54 -0400 Received: from mail.magicbluesmoke.com ([82.195.144.49]:37890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQjR7-0000lk-EE for control@debbugs.gnu.org; Fri, 22 Jul 2016 19:00:53 -0400 Received: from [192.168.1.80] (unknown [109.77.96.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id AC3F1244 for ; Sat, 23 Jul 2016 00:00:52 +0100 (IST) To: GNU bug tracker automated control server From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <5792A5A3.8050107@draigBrady.com> Date: Sat, 23 Jul 2016 00:00:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) 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: tag 24054 notabug close 24054 stop [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control 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.0 (++) 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: tag 24054 notabug close 24054 stop [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject tag 24054 notabug close 24054 stop From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 14:24:02 2016 Received: (at 24054) by debbugs.gnu.org; 23 Jul 2016 18:24:02 +0000 Received: from localhost ([127.0.0.1]:35148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR1ak-0005o0-HY for submit@debbugs.gnu.org; Sat, 23 Jul 2016 14:24:02 -0400 Received: from w1.tutanota.de ([81.3.6.162]:60668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR1ah-0005nP-Vt for 24054@debbugs.gnu.org; Sat, 23 Jul 2016 14:24:00 -0400 Received: from localhost (unknown [127.0.0.1]) by w1.tutanota.de (Postfix) with ESMTP id 9FB6CFA8A61 for <24054@debbugs.gnu.org>; Sat, 23 Jul 2016 18:23:53 +0000 (UTC) Received: from w1.tutanota.de ([127.0.0.1]) by localhost (w1.tutanota.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m8EaS-JY3Z_W for <24054@debbugs.gnu.org>; Sat, 23 Jul 2016 18:23:53 +0000 (UTC) Received: from w1.tutanota.de (unknown [127.0.0.1]) by w1.tutanota.de (Postfix) with ESMTP id 52AEBFA8A55 for <24054@debbugs.gnu.org>; Sat, 23 Jul 2016 18:23:53 +0000 (UTC) Date: Sat, 23 Jul 2016 19:23:53 +0100 (BST) From: To: <24054@debbugs.gnu.org> Message-ID: Subject: Thanks. Answer applies to all bracketed expressions? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_54389_643460351.1469298233310" X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 24054 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.0 (--) ------=_Part_54389_643460351.1469298233310 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Yep, that fixed it. I tested [:print:] and it works like that also. I presume this applies to ALL the bracketed special expressions mentioned in man tr. If anyone knows differently, please correct me. I'm surprised I haven't bashed into this pitfall sooner. Thanks, Mr. Gordon, for replying in a flash. ------=_Part_54389_643460351.1469298233310 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
Yep, that fixed it. I tested [:print:] and it works like that also. I presume this applies to ALL the bracketed special expressions mentioned in man tr. If anyone knows differently, please correct me. I'm surprised I haven't bashed into this pitfall sooner.

Thanks, Mr. Gordon, for replying in a flash.
------=_Part_54389_643460351.1469298233310-- From unknown Fri Jun 13 09:56:57 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 21 Aug 2016 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