[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
test binary
From: |
Kenneth J Vojtech |
Subject: |
test binary |
Date: |
Thu, 21 Jul 2005 12:22:50 -0700 |
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:
address@hidden:~/tmp> touch `date +%m%d%y%H%M%S`.hdr
address@hidden:~/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
address@hidden:~/tmp> test -e *.hdr
address@hidden:~/tmp> echo $?
0
address@hidden:~/tmp> touch `date +%m%d%y%H%M%S`.hdr
address@hidden:~/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
address@hidden:~/tmp> test -e *.hdr
-sh: test: too many arguments
address@hidden:~/tmp> echo $?
2
address@hidden:~/tmp> touch `date +%m%d%y%H%M%S`.hdr
address@hidden:~/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
address@hidden:~/tmp> test -e *.hdr
-sh: test: too many arguments
address@hidden:~/tmp> echo $?
2
address@hidden:~/tmp> ls -l /usr/bin/test
-rwxr-xr-x 1 root root 22912 2003-06-28 21:18 /usr/bin/test
address@hidden:~/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
- test binary,
Kenneth J Vojtech <=