This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: rename to insight
- To: tromey at cygnus dot com
- Subject: Re: rename to insight
- From: cgd at sibyte dot com (Chris G. Demetriou)
- Date: 22 Nov 2000 09:41:55 -0800
- Cc: insight at sourceware dot cygnus dot com
- References: <874s10dfwt.fsf@creche.cygnus.com> <mailpost.974851789.4627@postal.sibyte.com>
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