This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: empty directory globbing in bash/sh for loops


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Alessio.MASSARO@oxinst.co.uk on 3/2/2006 6:10 AM:
> In the Cygwin bash the following statement
> 
> for file in ./SOME_EMPTY_DIR/* ; do do_it_on $file ; done
> 
> executes the following once because of how globbing is done.
> 
> do_it_on ./SOME_EMPTY_DIR/*

Correct - POSIX requires that.  However, bash also has the 'shopt -s
nullglob' which may help in your situation.

> 
> Unfortunately the gcc 4.0.2 makefiles do use this on possibly empty
> directories and break.
> 
> Does anybody know how to solve this, please?

If it hurts, don't do it.  Report the bug to the gcc folks, if they aren't
being robust enough to protect against an empty directory.

> Unless stated above to be non-confidential, this E-mail and any 
> attachments are private and confidential and are for the addressee 
> only and may not be used, copied or disclosed save to the addressee.

Oops - not anymore.  Please don't send email to publicly archived mailing
lists with unenforceable legalese trash at the bottom (open up a free
web-based account, if necessary).

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
volunteer cygwin bash maintainer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEBvrT84KuGfSFAYARAp9CAKDZBFlVLVzsGZG2Kw4njzl0GWwHrgCcCHWx
eG/Kto3FzNxk3+6LuHJRvxI=
=M2iD
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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