From owner-freebsd-questions@FreeBSD.ORG Wed Mar 2 13:04:42 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 77A5016A4CE for ; Wed, 2 Mar 2005 13:04:42 +0000 (GMT) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 5D6B843D31 for ; Wed, 2 Mar 2005 13:04:41 +0000 (GMT) (envelope-from m@MHoerich.de) Received: (qmail invoked by alias); 02 Mar 2005 13:04:39 -0000 Received: from p548CD675.dip.t-dialin.net (EHLO localhost) (84.140.214.117) by mail.gmx.net (mp028) with SMTP; 02 Mar 2005 14:04:39 +0100 X-Authenticated: #5114400 Date: Wed, 2 Mar 2005 14:04:57 +0100 From: Mario Hoerich To: Jarrod - Cybertek Message-ID: <20050302130456.GA6144@Pandora.MHoerich.de> References: <20050302102921.GA92791@xor.obsecurity.org> <20050302110159.E6E2F1FFC6D@overport.cybertek.co.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050302110159.E6E2F1FFC6D@overport.cybertek.co.za> User-Agent: Mutt/1.4.2.1i X-Y-GMX-Trusted: 0 cc: questions@freebsd.org cc: 'Kris Kennaway' Subject: Re: referencing in files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2005 13:04:42 -0000 # Jarrod - Cybertek: > > Say i have a file /root/setup.client.sh, and it has this line: > IFACE=ng10 > Now I want to have the motd, when it is displayed after login, to go fetch > the current value of that IFACE, and display that value. This probably won't get any points for style, but instead of using /etc/motd, you could just as well do this with a small script in your .zlogin/.login/whatever file. E.g. if [ ! -e .hushlogin ]; then IF=`awk '/IFACE *=/ { gsub(/IFACE *= */,""); print; }' setup.client.sh` echo "My interface: $IF" fi HTH Mario