GNU bug report logs -
#12336
test bug
Previous Next
Reported by: Bala Murugan <bala.spidy <at> gmail.com>
Date: Sun, 2 Sep 2012 18:19:01 UTC
Severity: normal
Tags: notabug
Done: Bob Proulx <bob <at> proulx.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
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 <at> cl-flor-dvvm026 ~]$ test -f "test*.txt"
> [balamup2 <at> cl-flor-dvvm026 ~]$ echo $?
> 1
> [balamup2 <at> 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
This bug report was last modified 12 years and 256 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.