In zLinux for o/s390 (SuSe v 8 64 bit) is a binary 'test' that we use to
test for the existence of files.  One of our tests uses a wildcard to check
for any *.hdr files in a certain directory.  When there is more than one
*.hdr file in this directory, the test fails with an exit 2, so we are not
processing any files.  Is there an option that will allow the test command
to end with exit 0 if multiple files are found?  Or is this a bug?

We are using the test command on aix v 5.2 to process multiple files with
no problems.

Example of failure:
[EMAIL PROTECTED]:~/tmp> touch `date +%m%d%y%H%M%S`.hdr
[EMAIL PROTECTED]:~/tmp> ls -al
total 2
drwxrwxrwx    2 maestro  unison         80 2005-07-21 10:54 .
drwxr-xr-x   28 maestro  unison       1520 2005-07-21 09:22 ..
-rw-r--r--    1 maestro  unison          0 2005-07-21 10:54
072105105406.hdr
[EMAIL PROTECTED]:~/tmp> test -e *.hdr
[EMAIL PROTECTED]:~/tmp> echo $?
0
[EMAIL PROTECTED]:~/tmp> touch `date +%m%d%y%H%M%S`.hdr
[EMAIL PROTECTED]:~/tmp> ls -al
total 2
drwxrwxrwx    2 maestro  unison        112 2005-07-21 10:54 .
drwxr-xr-x   28 maestro  unison       1520 2005-07-21 09:22 ..
-rw-r--r--    1 maestro  unison          0 2005-07-21 10:54
072105105406.hdr
-rw-r--r--    1 maestro  unison          0 2005-07-21 10:54
072105105448.hdr
[EMAIL PROTECTED]:~/tmp> test -e *.hdr
-sh: test: too many arguments
[EMAIL PROTECTED]:~/tmp> echo $?
2
[EMAIL PROTECTED]:~/tmp> touch `date +%m%d%y%H%M%S`.hdr
[EMAIL PROTECTED]:~/tmp> ls -al
total 2
drwxrwxrwx    2 maestro  unison        144 2005-07-21 10:55 .
drwxr-xr-x   28 maestro  unison       1520 2005-07-21 09:22 ..
-rw-r--r--    1 maestro  unison          0 2005-07-21 10:54
072105105406.hdr
-rw-r--r--    1 maestro  unison          0 2005-07-21 10:54
072105105448.hdr
-rw-r--r--    1 maestro  unison          0 2005-07-21 10:55
072105105534.hdr
[EMAIL PROTECTED]:~/tmp> test -e *.hdr
-sh: test: too many arguments
[EMAIL PROTECTED]:~/tmp> echo $?
2
[EMAIL PROTECTED]:~/tmp> ls -l /usr/bin/test
-rwxr-xr-x    1 root     root        22912 2003-06-28 21:18 /usr/bin/test
[EMAIL PROTECTED]:~/tmp> file /usr/bin/test
/usr/bin/test: ELF 64-bit MSB executable, version 1 (SYSV), dynamically
linked (
uses shared libs), stripped


Any feedback is appreciated

Regards,
kv




_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to