From owner-freebsd-questions Sun Jul 2 15: 5: 1 2000 Delivered-To: freebsd-questions@freebsd.org Received: from manatee.mammalia.org (manatee.mammalia.org [216.231.50.6]) by hub.freebsd.org (Postfix) with ESMTP id 960E937B73F for ; Sun, 2 Jul 2000 15:04:58 -0700 (PDT) (envelope-from rjoseph@mammalia.org) Received: by manatee.mammalia.org (Postfix, from userid 1000) id 307D511CE07; Sun, 2 Jul 2000 15:04:58 -0700 (PDT) Date: Sun, 2 Jul 2000 15:04:58 -0700 From: R Joseph Wright To: R Joseph Wright Cc: freebsd-questions@FreeBSD.org Subject: Re: making shell script run in its own directory Message-ID: <20000702150458.C66917@manatee.mammalia.org> References: <20000702130901.A66305@manatee.mammalia.org> <20000702211344.38B1216F@woodstock.monkey.net> <20000702145903.A66917@manatee.mammalia.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20000702145903.A66917@manatee.mammalia.org>; from rjoseph@mammalia.org on Sun, Jul 02, 2000 at 02:59:03PM -0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, Jul 02, 2000 at 02:59:03PM -0700, R Joseph Wright wrote: > On Sun, Jul 02, 2000 at 04:13:44PM -0500, Jon Hamilton wrote: > > > > In message <20000702130901.A66305@manatee.mammalia.org>, R Joseph Wright wrote: > > } How do I make a shell script run in the directory where it resides rather tha > > } n > > } the directory where it was called from? > > > > Before you do anything interesting in the script, add a line like: > > > > cd $(dirname $0) > > > > Though generally I consider this kind of thing bad practice. > > It works! Can yourself on that last point? ^^^^^^^^ Oops, I meant to say "Can you explain yourself on that last point?" > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message