From mboxrd@z Thu Jan 1 00:00:00 1970 From: cgd@sibyte.com (Chris G. Demetriou) To: tromey@cygnus.com Cc: insight@sourceware.cygnus.com Subject: Re: rename to insight Date: Wed, 22 Nov 2000 09:42:00 -0000 Message-id: <5t7l5vaopo.fsf@highland.sibyte.com> References: <874s10dfwt.fsf@creche.cygnus.com> X-SW-Source: 2000-q4/msg00270.html tromey@cygnus.com (Tom Tromey) writes: > +exec gdb -w ${1+"$@"} I believe there's a slight problem with this: This may get you a different 'gdb' than the one corresponding to the 'insight' being invoked. $PATH is used to find gdb, but not necessarily to find the 'insight' shell script in this case. The good news is, i'm pretty sure that pretty much all UNIX-ish systems invoke shell scripts with a path of the script as $0 (relative if the script was invoked via a relative path, absolute if via an absolute path or $PATH) so you could do something like: gdbpath="`dirname $0`" exec $gdbpath/gdb ... (At least, all of the ones i could find right now do, and in general that's been my experience... and i rely in it in scripts. I dunno what standards say, if anything.) of course, 'dirname' isn't as portable as you might like... chris