delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/07/11/02:24:38

From: mh AT mike DOT franken DOT de (Michael Hirmke)
Subject: Re: Potential 'test' bug
11 Jul 1998 02:24:38 -0700 :
Message-ID: <6xegEva4pfB.cygnus.gnu-win32@mike.franken.de>
References: <9807099000 DOT AA900011345 AT ftdetrck-ccmail DOT army DOT mil>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

Hi,

[...]
>        I am not certain the command "test -f /temp/*" is valid,

No it is not - the shell expands '*' to all the available filenames,
before test gets them, so your command really looks like
    test -f /tmp/foo /tmp/bar ...

[...]
>        Perhaps another file operator is required to test if a directory
>        contains one or more files.

in bash for example:

test $( ls -l /temp/* 2>/dev/null | wc -l ) -gt 0

[...]

Bye.
Michael.
--
Michael Hirmke           | Telefon +49 (911) 557999
Georg-Strobel-Strasse 81 | FAX     +49 (911) 557664
90489 Nuernberg          | E-Mail  mailto:mh AT mike DOT franken DOT de
                         | WWW     http://aquarius.franken.de/
-
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