From owner-freebsd-questions Sun Jul 2 14: 8:34 2000 Delivered-To: freebsd-questions@freebsd.org Received: from merlin.prod.itd.earthlink.net (merlin.prod.itd.earthlink.net [207.217.120.156]) by hub.freebsd.org (Postfix) with ESMTP id 5658737B52E for ; Sun, 2 Jul 2000 14:08:32 -0700 (PDT) (envelope-from cjc@earthlink.net) Received: from dialin-client.earthlink.net (pool0639.cvx20-bradley.dialup.earthlink.net [209.179.252.129]) by merlin.prod.itd.earthlink.net (8.9.3-EL_1_3/8.9.3) with ESMTP id OAA04946; Sun, 2 Jul 2000 14:08:03 -0700 (PDT) Received: (from cjc@localhost) by dialin-client.earthlink.net (8.9.3/8.9.3) id OAA04304; Sun, 2 Jul 2000 14:06:09 -0700 (PDT) Date: Sun, 2 Jul 2000 14:06:02 -0700 From: "Crist J. Clark" To: R Joseph Wright Cc: freebsd-questions@FreeBSD.ORG Subject: Re: making shell script run in its own directory Message-ID: <20000702140601.E3842@dialin-client.earthlink.net> Reply-To: cjclark@alum.mit.edu References: <20000702130901.A66305@manatee.mammalia.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <20000702130901.A66305@manatee.mammalia.org>; from rjoseph@mammalia.org on Sun, Jul 02, 2000 at 01:09:01PM -0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, Jul 02, 2000 at 01:09:01PM -0700, R Joseph Wright wrote: > How do I make a shell script run in the directory where it resides rather than > the directory where it was called from? Assuming sh(1), I think this would do it, cd `dirname $0` -- Crist J. Clark cjclark@alum.mit.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message