From owner-freebsd-newbies Fri May 24 14:15: 9 2002 Delivered-To: freebsd-newbies@freebsd.org Received: from andrsn.stanford.edu (andrsn.Stanford.EDU [171.66.112.163]) by hub.freebsd.org (Postfix) with ESMTP id 40DD337B414; Fri, 24 May 2002 14:15:02 -0700 (PDT) Received: from localhost (localhost.stanford.edu [127.0.0.1]) by andrsn.stanford.edu (8.11.6/8.11.6) with ESMTP id g4OL1ZH40125; Fri, 24 May 2002 14:01:35 -0700 (PDT) (envelope-from andrsn@andrsn.stanford.edu) Date: Fri, 24 May 2002 14:01:35 -0700 (PDT) From: Annelise Anderson To: Vinod Cc: freebsd-newbies@FreeBSD.ORG, freebsd-net@FreeBSD.ORG Subject: Re: setting up batch files In-Reply-To: <20020524203214.30158.qmail@web21101.mail.yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-newbies@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, 24 May 2002, Vinod wrote: > whats the best way to execute a series of commands in > freebsd?something like a batch file in MS-DOS. > > suppose i want to execute the two commands, > defaultrouter="a.b.c.d" > ifconfig_eth0="inet e.f.g.h netmask e.f.g.h" > by typing something like 'change' on the terminal > window;howdo i go about this? > note these two commands are set in /etc/rc.conf and i > want to execute the changes through a batch sort of > file. > Thanks in advance, > vinod > > __________________________________________________ > Do You Yahoo!? > LAUNCH - Your Yahoo! Music Experience > http://launch.yahoo.com > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-newbies" in the body of the message > You use a shell script; put the commands in the script as you would type them at the command line; make the shell script executable; run it. The commands aren't really set in /etc/rc.conf; only the values of the variables are set there. /etc/rc and scripts it calls actually run the commands. So if you don't want to reboot, do it at the command line or do a shell script. Annelise -- Annelise Anderson Author of: FreeBSD: An Open-Source Operating System for Your PC Available from: BSDmall.com and amazon.com Book Website: http://www.bittreepress.com/FreeBSD/introbook/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-newbies" in the body of the message