[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [[ -z ]] nullglob problem?
From: |
Chet Ramey |
Subject: |
Re: [[ -z ]] nullglob problem? |
Date: |
Thu, 25 Oct 2007 08:10:10 -0400 |
> Machine Type: i686-pc-linux-gnu
>
> Bash Version: 3.1
> Patch Level: 0
> Release Status: release
>
> Description:
> [[ -z seem to handle nullglob variables incorrect.
> See the Repeat-By below.
>
> Repeat-By:
>
> mkdir empty
> shopt -s nullglob
> if [[ -z empty/* ]]
> then
> echo empty
> fi
>
> Shouldn't this echo empty?
No, since, as documented, the conditional operator does not perform
pathname expansion on its operands.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Live Strong.
Chet Ramey, ITS, CWRU chet@case.edu http://tiswww.tis.case.edu/~chet/