This is the mail archive of the
mailing list for the Cygwin project.
Re: empty directory globbing in bash/sh for loops
-----BEGIN PGP SIGNED MESSAGE-----
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 email@example.com
volunteer cygwin bash maintainer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v184.108.40.206 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html