This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: rename to insight


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]