From owner-freebsd-questions Mon Oct 30 9: 6:53 2000 Delivered-To: freebsd-questions@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id DE2B137B4C5 for ; Mon, 30 Oct 2000 09:06:50 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id e9UH6nx18917; Mon, 30 Oct 2000 09:06:49 -0800 (PST) Date: Mon, 30 Oct 2000 09:06:49 -0800 From: Alfred Perlstein To: Jeremy Vandenhouten Cc: questions@freebsd.org Subject: Re: Automated Scripts Message-ID: <20001030090649.U22110@fw.wintelcom.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i In-Reply-To: ; from jeremy.vandenhouten@marquette.edu on Mon, Oct 30, 2000 at 11:04:06AM -0600 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Jeremy Vandenhouten [001030 09:04] wrote: > > > > the file, is it possible to put perl scripts into rc.d as well? > > > > It _looks_ possible: > > > > case ${local_startup} in > > [Nn][Oo] | '') > > ;; > > *) > > echo -n 'Local package initialization:' > > for dir in ${local_startup}; do > > if [ -d "${dir}" ]; then > > for script in ${dir}/*.sh; do > > if [ -x "${script}" ]; then > > (set -T > > trap 'exit 1' 2 > > ${script} start) > > fi > > done > > fi > > done > > echo . > > ;; > > > > Given this line right here: > > for script in ${dir}/*.sh; do > > It looks like all you would have to do is add another identical for > loop and add something similar... For instance if all your perl scripts > ended in .pl... Well you don't need them to end with .pl, having the perl interpreter magic is sufficient, you can name a perl script foo.sh as long as you have the interpreter line set. If you wanted to you could make a .sh that was a /bin/sh script that would just run a .pl that's in /usr/local/etc/rc.d/something.pl. > > for script in ${dir}/*.pl; do > > Yes, yes I know that is supposed to be for older perl libraries but in > this case... > > Just one question, where did this snippet come from? /etc/rc :) -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message