From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Q4qIt-00052n-Ew for garchives@archives.gentoo.org; Wed, 30 Mar 2011 07:58:59 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4AA951C099; Wed, 30 Mar 2011 07:58:50 +0000 (UTC) Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) by pigeon.gentoo.org (Postfix) with ESMTP id 99D6F1C067 for ; Wed, 30 Mar 2011 07:58:19 +0000 (UTC) Received: from gentoo.org (volund.ins.cwi.nl [192.16.196.166]) by hera.cwi.nl with ESMTP id p2U7wI3I025808 for ; Wed, 30 Mar 2011 09:58:18 +0200 (CEST) Date: Wed, 30 Mar 2011 09:58:18 +0200 From: Fabian Groffen To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] Re: RFC: postgresql.eselect Message-ID: <20110330075818.GH90632@gentoo.org> Mail-Followup-To: gentoo-dev@lists.gentoo.org References: <4D914FC5.7040109@gentoo.org> <19857.41217.854435.807699@a1i15.kph.uni-mainz.de> <4D92497D.30100@gentoo.org> <20110329223548.17db0114@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20110329223548.17db0114@gentoo.org> User-Agent: Mutt/1.5.21 (Darwin 9.8.0, VIM - Vi IMproved 7.3) Organization: Gentoo Foundation, Inc. X-Archives-Salt: X-Archives-Hash: 5d3e82bd0d30fe83d79f8ae9184eb950 On 29-03-2011 22:35:48 -0600, Ryan Hill wrote: > > Because 'ls' would complain that files didn't exist, such as lib*.dylib > > when on a Linux system. It doesn't matter. But, using 'find' avoids this > > mess. > > Never use ls to get filenames in a script. Instead of > > for link_source in $(eval ls ${source_dir} 2> /dev/null) ; do > > just use > > for link_source in "${source_dir}"/* ; do > > I see you already fixed this one, but you do some funky stuff with ls -d > earlier on. Make sure though, when you use a glob, that you check for the asterisk. When there are no matches, bash assumes you meant the literal '*' and hence will return "/foo/bar/*" in link_source. So make sure you check the existence of whatever is in link_source before using it. -- Fabian Groffen Gentoo on a different level