From unknown Fri Aug 15 03:57:06 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#12336 <12336@debbugs.gnu.org> To: bug#12336 <12336@debbugs.gnu.org> Subject: Status: test bug Reply-To: bug#12336 <12336@debbugs.gnu.org> Date: Fri, 15 Aug 2025 10:57:06 +0000 retitle 12336 test bug reassign 12336 coreutils submitter 12336 Bala Murugan severity 12336 normal tag 12336 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 02 14:18:17 2012 Received: (at submit) by debbugs.gnu.org; 2 Sep 2012 18:18:17 +0000 Received: from localhost ([127.0.0.1]:34754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T8EkS-0001Bu-QM for submit@debbugs.gnu.org; Sun, 02 Sep 2012 14:18:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55285) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T8ADk-0002Aw-Qm for submit@debbugs.gnu.org; Sun, 02 Sep 2012 09:28:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8ACK-0000Mm-Ue for submit@debbugs.gnu.org; Sun, 02 Sep 2012 09:26:45 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:33318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8ACK-0000Mi-Rd for submit@debbugs.gnu.org; Sun, 02 Sep 2012 09:26:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8ACK-0003lG-4G for bug-coreutils@gnu.org; Sun, 02 Sep 2012 09:26:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8ACJ-0000MY-9F for bug-coreutils@gnu.org; Sun, 02 Sep 2012 09:26:44 -0400 Received: from mail-bk0-f41.google.com ([209.85.214.41]:36082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8ACJ-0000MQ-2Q for bug-coreutils@gnu.org; Sun, 02 Sep 2012 09:26:43 -0400 Received: by bkcjc3 with SMTP id jc3so1825767bkc.0 for ; Sun, 02 Sep 2012 06:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=N8LBFn+u1H66DFACMfKK/2faYChG8ekLMGfQmJhjoE0=; b=Ob+Vl1y+VMg3nCXInfJWf/NlxY3EczWIQwh4nl61v+Cedh6VlauT9tbG/39C8HzDe6 3AghLEFRgkfRnaj33uXmghtNevPq1J2jNYbgesQancrBUi83aVFOLP4Qa8G8dLO6V2f1 Qd34HRgUOQyR8uNvj6poq50nNLpeWcINzUn1iQn5fQ067oFa9Qz4nIm5f6WSBwSpnycw at0W53GWmGM/8NJpYgfv2oTqcNZzDJmIoM+uxIiELuvoEQhLIVURh9nz8qOJP6jt61zQ ZWkjrfzuLk4RU8b+gD1TNDB6y4M8KZ4i7/ilZbVYOTSchQC6dSG3CdXwsAzWSY395pUV XUQw== MIME-Version: 1.0 Received: by 10.204.0.80 with SMTP id 16mr5834554bka.71.1346592400151; Sun, 02 Sep 2012 06:26:40 -0700 (PDT) Received: by 10.204.24.11 with HTTP; Sun, 2 Sep 2012 06:26:39 -0700 (PDT) Date: Sun, 2 Sep 2012 18:56:39 +0530 Message-ID: Subject: test bug From: Bala Murugan To: bug-coreutils@gnu.org Content-Type: multipart/alternative; boundary=00151750e2c6ab166504c8b7f961 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 02 Sep 2012 14:18:14 -0400 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 (------) --00151750e2c6ab166504c8b7f961 Content-Type: text/plain; charset=ISO-8859-1 Hi team , we are using Red Hat Enterprise Linux Server release 5.8. Our default shell is BASH. while using *test command* for single file its working fine.But when we use test command for multiple files we are facing this issue. I will paste the issue. [balamup2@cl-flor-dvvm026 ~]$ test -f "test*.txt" [balamup2@cl-flor-dvvm026 ~]$ echo $? 1 [balamup2@cl-flor-dvvm026 ~]$ but its working fine for KSH shell. --00151750e2c6ab166504c8b7f961 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi team ,
we are using Red Hat Enterprise Linux Server release 5.8. Our = default shell is BASH. while using test command for single file its = working fine.But when we use test command for multiple files we are facing = this issue. I will paste the issue.

[balamup2@cl-flor-dvvm026 ~]$ test -f "test*.txt"
[balamup= 2@cl-flor-dvvm026 ~]$ echo $?
1
[balamup2@cl-flor-dvvm026 ~]$

=
but its working fine for KSH shell.
--00151750e2c6ab166504c8b7f961-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 02 16:31:10 2012 Received: (at 12336) by debbugs.gnu.org; 2 Sep 2012 20:31:10 +0000 Received: from localhost ([127.0.0.1]:34889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T8Gp3-0005C5-Tt for submit@debbugs.gnu.org; Sun, 02 Sep 2012 16:31:10 -0400 Received: from joseki.proulx.com ([216.17.153.58]:33633) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T8Gp1-0005Bu-8E; Sun, 02 Sep 2012 16:31:08 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 1037D211D9; Sun, 2 Sep 2012 14:29:38 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id C17342DCC2; Sun, 2 Sep 2012 14:29:37 -0600 (MDT) Date: Sun, 2 Sep 2012 14:29:37 -0600 From: Bob Proulx To: Bala Murugan Subject: Re: bug#12336: test bug Message-ID: <20120902202937.GA2626@hysteria.proulx.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 12336 Cc: 12336@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.1 (--) tag 12336 + notabug moreinfo thanks Bala Murugan wrote: > we are using Red Hat Enterprise Linux Server release 5.8. Our default shell > is BASH. while using *test command* for single file its working fine.But > when we use test command for multiple files we are facing this issue. I > will paste the issue. Thank you for the report. However this is almost certainly not a bug in test but instead is a usage problem. First though test is both a standalone coreutils command (usually /usr/bin/test) and a shell builtin command. Using it as you are using it above will invoke the shell builtin and not the standalone. You have reported this to the coreutils bug tracker for the standalone. For the builtin you should report it to the bash shell bug list. However in this case there isn't any difference between the two. But if you are going to report here then you should call the command /usr/bin/test in order to use our version of the test command. > while using *test command* for single file its working fine. The test command example you showed was only for a single file. But it included a '*' character (which was properly quoted) and therefore > But when we use test command for multiple files we are facing this > issue. I fear that you might be trying to use it as a shell file glob. That won't work. The test -f action is only designed to take a single argument. It isn't designed to take multiple arguments. By what you have said it seems you are trying to pass in multiple arguments. That would be an incorrect usage. > I will paste the issue. > > [balamup2@cl-flor-dvvm026 ~]$ test -f "test*.txt" > [balamup2@cl-flor-dvvm026 ~]$ echo $? > 1 > [balamup2@cl-flor-dvvm026 ~]$ If there is no file named "test*.txt" with exactly those characters including the '*' character then the above is correct behavior. Please include the output of: $ ls -ldog "test*.txt" > but its working fine for KSH shell. Please paste an exact example. I cannot reproduce that behavior. Bob From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 04 20:08:41 2012 Received: (at 12336) by debbugs.gnu.org; 5 Sep 2012 00:08:41 +0000 Received: from localhost ([127.0.0.1]:39096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T93Ae-0004vK-MB for submit@debbugs.gnu.org; Tue, 04 Sep 2012 20:08:40 -0400 Received: from joseki.proulx.com ([216.17.153.58]:47128) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T93Ac-0004vD-8k for 12336@debbugs.gnu.org; Tue, 04 Sep 2012 20:08:39 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 00EDC21250 for <12336@debbugs.gnu.org>; Tue, 4 Sep 2012 18:08:33 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 8F1942DCD0; Tue, 4 Sep 2012 18:08:33 -0600 (MDT) Resent-From: Bob Proulx Resent-Date: Tue, 4 Sep 2012 18:08:33 -0600 Resent-Message-ID: <20120905000833.GA21049@hysteria.proulx.com> Resent-To: 12336@debbugs.gnu.org X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on hysteria.proulx.com X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_05,FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 X-Original-To: bob@hysteria.proulx.com Received: from joseki.proulx.com (joseki.proulx.com [192.168.230.3]) by hysteria.proulx.com (Postfix) with ESMTP id DACEB2DC6C for ; Mon, 3 Sep 2012 08:51:43 -0600 (MDT) Received: by joseki.proulx.com (Postfix, from userid 1000) id D1BAC21434; Mon, 3 Sep 2012 08:51:43 -0600 (MDT) X-Original-To: bob@proulx.com X-External-Mail: yes Received: from mail-bk0-f47.google.com (mail-bk0-f47.google.com [209.85.214.47]) by joseki.proulx.com (Postfix) with ESMTP id 4BA48211D4 for ; Mon, 3 Sep 2012 08:51:43 -0600 (MDT) Received: by bkcik5 with SMTP id ik5so2104191bkc.34 for ; Mon, 03 Sep 2012 07:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=yylz5n98esR2udHm+DP4t/8IbibXb8VXmVSDK7+zERs=; b=J09O7dsriZBgVtoyt1kLxXa3qYXla0GyGiiNSBdn8XmoWll/ZczoIAlDAdYhizKT6M 18XlCz9sLQ8a1QPXDzTiyqPdTHpseq+4SjO20iNaH5byCBDUGh51BUapUoyxvQ+JpEK+ gLjkp33GFiV0Sa1UNTUTeuRJINOwaWY8bn+TaAfNZ9CwHZPKlWsIWX+03KXkOQCnCowt yd56QFAiFodk7dfd73j2YZW9EdgReqDfBckftZ870UUlC0/x5R7VOayEsQnW/EzPSI4f vLCYNahP2h3HQ2I5TUXTfRYXG1G4K61aefbQHHa9tTSDEpu7JIU1TEq2TBMYPXqf7ha7 Zupw== MIME-Version: 1.0 Received: by 10.204.129.23 with SMTP id m23mr7159958bks.28.1346683901793; Mon, 03 Sep 2012 07:51:41 -0700 (PDT) Received: by 10.204.24.11 with HTTP; Mon, 3 Sep 2012 07:51:41 -0700 (PDT) In-Reply-To: <20120902202937.GA2626@hysteria.proulx.com> References: <20120902202937.GA2626@hysteria.proulx.com> Date: Mon, 3 Sep 2012 20:21:41 +0530 Message-ID: Subject: Re: bug#12336: test bug From: Bala Murugan To: Bob Proulx Content-Type: multipart/alternative; boundary=001517447fec9753fc04c8cd4749 X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 12336 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.1 (--) --001517447fec9753fc04c8cd4749 Content-Type: text/plain; charset=ISO-8859-1 Hi Bob, thanks for u r reply. See i will explain u neatly. I am using bash shell. When I tried to do this i getting this.I am getting this error. [balamup2@cl-flor-dvvm026 ~]$ echo $SHELL */bin/bash* [balamup2@cl-flor-dvvm026 ~]$ ls *test1.txt test3.txt testdir test.txt* [balamup2@cl-flor-dvvm026 ~]$ test -f test*.txt *-bash: test: too many arguments* -------------------------------------------------------------------------------------------- But my friend is using ksh shell. He is fine with that command . I will past this O/P also. $ echo $SHELL */usr/bin/ksh* $ ls *123.txt a1.txt abc.txt a.txt dead.letter nohup.out ww1.txt* $ test -f a*.txt $ echo $? *0* Please take a deep look and resolve this problem --001517447fec9753fc04c8cd4749 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Bob,
thanks for u r reply.
See i will explain u neatly.
I am us= ing bash shell. When I tried to do this i getting this.I am getting this er= ror.
=A0
[balamup2@cl-flor-dvvm026 ~]$ echo $SHELL
/bin/bash

[balamup2@cl-flor-dvvm026 ~]$ ls
test1.txt=A0 test3.txt=A0 testdi= r=A0 test.txt

[balamup2@cl-flor-dvvm026 ~]$ test -f test*.txt-bash: test: too many arguments
--------------------------------= ------------------------------------------------------------
But my friend is using ksh shell. He is fine with that command . I will pas= t this O/P also.

$ echo $SHELL
/usr/bin/ksh

$ ls123.txt=A0 a1.txt=A0 abc.txt=A0 a.txt=A0 dead.letter=A0 nohup.out=A0 ww= 1.txt

$ test -f a*.txt
$ echo $?
0


Please take a deep= look and resolve this problem


--001517447fec9753fc04c8cd4749-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 04 20:18:27 2012 Received: (at 12336) by debbugs.gnu.org; 5 Sep 2012 00:18:27 +0000 Received: from localhost ([127.0.0.1]:39104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T93K6-000595-Mx for submit@debbugs.gnu.org; Tue, 04 Sep 2012 20:18:26 -0400 Received: from joseki.proulx.com ([216.17.153.58]:47159) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T93K4-00058x-Q8 for 12336@debbugs.gnu.org; Tue, 04 Sep 2012 20:18:25 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id C227521250; Tue, 4 Sep 2012 18:18:20 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id A5A8A2DCD0; Tue, 4 Sep 2012 18:18:20 -0600 (MDT) Date: Tue, 4 Sep 2012 18:18:20 -0600 From: Bob Proulx To: Bala Murugan Subject: Re: bug#12336: test bug Message-ID: <20120905001820.GB21049@hysteria.proulx.com> Mail-Followup-To: 12336@debbugs.gnu.org, Bala Murugan References: <20120902202937.GA2626@hysteria.proulx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 12336 Cc: 12336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: 12336@debbugs.gnu.org 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.1 (--) Please keep the mailing list in the reply. I have set Reply-To accordingly. Bala Murugan wrote: > I am using bash shell. When I tried to do this i getting this.I am getting > this error. > > [balamup2@cl-flor-dvvm026 ~]$ echo $SHELL > */bin/bash* I am sure that those '*' characters are not there. You must have added them for emphasis. > [balamup2@cl-flor-dvvm026 ~]$ ls > *test1.txt test3.txt testdir test.txt* So you have three files that match test*.txt in that directory. > [balamup2@cl-flor-dvvm026 ~]$ test -f test*.txt > *-bash: test: too many arguments* That is correct. You are passing in too many arguments. The test -f operator requires one argument. You have passed *three* arguments. That is two too many. You can verify this by using 'echo'. Try this: $ echo test -f test*.txt Using that you will see that the test*.txt is matching and being expanded by the shell into three arguments. It is almost always incorrect to pass a '*' or other shell file glob metacharacter unquoted on the command line to test. Your usage is very problematic. Instead you may want to loop over the files. for file in test*.txt; do test -f "$file" && echo file: "$file" || echo nofile: "$file" done > But my friend is using ksh shell. He is fine with that command . But does your friend have three files that match that file glob in his directory? Have you friend do this: $ touch test1.txt test2.txt test3.txt $ echo test -f test*.txt $ test -f test*.txt By creating the extra files with touch that should ensure that multiple files are matched. > I will past this O/P also. > > $ echo $SHELL > */usr/bin/ksh* > > $ ls > *123.txt a1.txt abc.txt a.txt dead.letter nohup.out ww1.txt* > > $ test -f a*.txt > $ echo $? > *0* I cannot reproduce that result. I tried this: $ mkdir /tmp/testdir $ cd /tmp/testdir /testdir$ touch 123.txt a1.txt abc.txt a.txt dead.letter nohup.out ww1.txt /testdir$ ls a*.txt a.txt a1.txt abc.txt /testdir$ test -f a*.txt bash: test: too many arguments That is correct behavior because a*.txt matches several files. > Please take a deep look and resolve this problem I am sorry but I think this is simply incorrect usage. Bob From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 12 16:48:41 2012 Received: (at 12336) by debbugs.gnu.org; 12 Sep 2012 20:48:41 +0000 Received: from localhost ([127.0.0.1]:57831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TBtrV-0005BY-Gj for submit@debbugs.gnu.org; Wed, 12 Sep 2012 16:48:41 -0400 Received: from joseki.proulx.com ([216.17.153.58]:34707) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TBtrT-0005BM-7a; Wed, 12 Sep 2012 16:48:40 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 6A74721250; Wed, 12 Sep 2012 14:47:50 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 45B0B2DC66; Wed, 12 Sep 2012 14:47:50 -0600 (MDT) Date: Wed, 12 Sep 2012 14:47:50 -0600 From: Bob Proulx To: 12336@debbugs.gnu.org, Bala Murugan Subject: Re: bug#12336: test bug Message-ID: <20120912204750.GA24666@hysteria.proulx.com> References: <20120902202937.GA2626@hysteria.proulx.com> <20120905001820.GB21049@hysteria.proulx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120905001820.GB21049@hysteria.proulx.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 12336 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.3 (--) tags 12336 - moreinfo close 12336 thanks I haven't seen anything new on this for a week. I believe this to be a usage problem. Therefore I am closing this bug ticket. If you have different or new information please feel free to respond with it. Bob From unknown Fri Aug 15 03:57: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: Thu, 11 Oct 2012 11:24:04 +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