This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Potential 'test' bug



     
     
     
     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
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]