Date: Sun, 2 Jul 2000 15:04:58 -0700 From: R Joseph Wright <rjoseph@mammalia.org> To: R Joseph Wright <rjoseph@mammalia.org> Cc: freebsd-questions@FreeBSD.org Subject: Re: making shell script run in its own directory Message-ID: <20000702150458.C66917@manatee.mammalia.org> In-Reply-To: <20000702145903.A66917@manatee.mammalia.org>; from rjoseph@mammalia.org on Sun, Jul 02, 2000 at 02:59:03PM -0700 References: <20000702130901.A66305@manatee.mammalia.org> <20000702211344.38B1216F@woodstock.monkey.net> <20000702145903.A66917@manatee.mammalia.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000702150458.C66917>