From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3329 invoked by uid 1002); 17 Jul 2003 02:18:10 -0000 Mailing-List: contact gentoo-dev-help@gentoo.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Received: (qmail 11822 invoked from network); 17 Jul 2003 02:18:10 -0000 Date: Wed, 16 Jul 2003 22:18:08 -0400 From: Aron Griffis To: gentoo-dev@gentoo.org Cc: carpaski@gentoo.org Message-ID: <20030717021807.GA17747@time> Mail-Followup-To: gentoo-dev@gentoo.org, carpaski@gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i Subject: [gentoo-dev] interesting bit of bash X-Archives-Salt: 426d885c-fc38-4844-ba75-8d12fbba7ade X-Archives-Hash: 71f8ee1546957e09a6b6a6cd7814e102 I don't know if this would be useful to anybody, but while looking into a bug, I came up with a method to determine what variables are set by a file such as make.conf or /etc/conf.d/* vars_in_file() { local _file=$1 ( eval "`export | sed 's/-/+/'`" # need double-quotes set -a # export all new vars . $_file # load up the vars export | sed -n 's/^declare -x \(.*\)=".*/\1/p' ) } This function will list the variables set in a file, for example $ vars_in_file /etc/make.conf ACCEPT_KEYWORDS CFLAGS CHOST CONFIG_PROTECT_MASK CXXFLAGS DISTCC_HOSTS DISTDIR FEATURES GENTOO_MIRRORS MAKEOPTS PORTAGE_NICENESS PORTDIR USE $ vars_in_file /etc/conf.d/net gateway iface_eth0 The listing should always be correct since the file is being interpreted (and executed) by bash. Aron -- gentoo-dev@gentoo.org mailing list