delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/07/10/07:01:53

From: john_baker AT ftdetrck-ccmail DOT army DOT mil
Subject: Potential 'test' bug
10 Jul 1998 07:01:53 -0700 :
Message-ID: <9807099000.AA900011345.cygnus.gnu-win32@ftdetrck-ccmail.army.mil>
Mime-Version: 1.0
To: <gnu-win32 AT cygnus DOT com>

     
     
     
     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 AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019