From owner-freebsd-questions@FreeBSD.ORG Mon Jan 3 20:31:00 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 BB96C16A4CF for ; Mon, 3 Jan 2005 20:31:00 +0000 (GMT) Received: from spatula.dreamhost.com (spatula.dreamhost.com [66.33.205.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9541243D53 for ; Mon, 3 Jan 2005 20:31:00 +0000 (GMT) (envelope-from lists@tntluoma.com) Received: from [192.168.2.102] (unknown [68.254.13.39]) by spatula.dreamhost.com (Postfix) with ESMTP id 9426617D037; Mon, 3 Jan 2005 12:30:58 -0800 (PST) In-Reply-To: <15416223037.20050103193803@hexren.net> References: <06DDB71C-5DB4-11D9-B56F-000D9333E43C@secure-computing.net> <15416223037.20050103193803@hexren.net> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <6074EB8D-5DC6-11D9-89A5-000D93AD26C8@tntluoma.com> Content-Transfer-Encoding: 7bit From: Timothy Luoma Date: Mon, 3 Jan 2005 15:30:58 -0500 To: Eric F Crist X-Mailer: Apple Mail (2.619) cc: FreeBSD-Questions Questions Subject: Re: my lame attempt at a shell script... 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: Mon, 03 Jan 2005 20:31:00 -0000 On Jan 3, 2005, at 1:38 PM, Hexren wrote: > I am not that great at bash but look in /etc/rc.firewall for the line > where it says: ". /etc/defaults/rc.conf" I think this line includes > /etc/rc.conf into the running script and as code in rc.conf is > evaluated at the time it is included, all the variables defined in > rc.conf are created at that time in your script. (you do realize that > for example gateway_enable="YES" is an variable declaration with > initialization when read as shell script ?) Hexren is right, ". /some/file" does mean "include /some/file" (sometimes called "source") #!/bin/sh . /etc/rc.conf if [ "$gateway_enable" = "YES" ] then echo "yes, this machine is a gateway" else echo "no, this is not a gateway" fi exit 0 TjL