[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: List expansion in a 'for in' control structure
From: |
Chet Ramey |
Subject: |
Re: List expansion in a 'for in' control structure |
Date: |
Sat, 30 Jul 2005 11:42:32 -0400 |
User-agent: |
Mozilla Thunderbird 1.0.6 (Macintosh/20050716) |
Till Halbach wrote:
> The bash manual for the control structure 'for name [ in word ] ; do
> list ; done' says:
> 'The list of words following in is expanded, generating a list of
> items.' However, if no files are found, it is set equal to the query
> string.
If you want filename expansion patterns which match no files to expand
to the null string rather than themselves, set the `nullglob' option
with `shopt -s nullglob'.
The word following `in' is expanded using the normal set of expansions.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live...Laugh...Love
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/