Subject: Potential 'test' bug
From: [email-masked]

10 Jul 1998 07:01:53 -0700
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
To: <[email-masked]>

     

     Observation of potential 'test' bug:
     
        The following fails if more than two files in /temp
        (or any other directory name ): 
     
        test -f /temp/*
     
        From BASH shell, error message is:
                bash-2.01$ test -f /temp/*
                test: /temp/a: binary operator expected
        From shell script, error message is:
                test: /temp/b: unknown operand
     
        If only zero or one file exists in the directory, the commands
        works as expected.
     
     Discussion:
        I am not certain the command "test -f /temp/*" is valid, 
        since until now I have only used a file name as the operand.
        It does seem to work under DG/UNIX, since I am porting working
        DG/UNIX code to NT.  More precisely, the test command begin used
        is:
                test -f /dir1/filename.*
        
        Perhaps another file operator is required to test if a directory
        contains one or more files.

     
     Operating System:
        Microsoft (R) Windows NT (TM) Workstation
        Version 4.0 (Build 1381: Service Pack 3) x86 Uniprocessor Free
     
     Version:
        GNU bash, version 2.01.1(2)-release (i386-pc-cygwin32)

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".