On 10/11/2013 04:00 PM, Jan Kratochvil wrote: > On Fri, 11 Oct 2013 20:22:05 +0200, Luis Machado wrote: >> Hmmm... unless there is some discrepancy between shell interpreters, >> mine (bash) does the following: > > OK, true, it works thanks to the 'which' command there. > > But then why you have there the conditional > if test "x$binary_path" = x. ; then > ? > You can run the 'which' block every time and it will work. That's true. Though i've noticed that the following gives an unexpected result... Invocation: sh gcore (with gcore living in ".") The /usr/bin/gdb binary gets picked up, because "which gcore" returns nothing even if gcore lives in ".". *sigh*. An additional check needs to be done. The attached update patch accomplishes this. It seems to cover all the scenarios. I decided to add a chunk of code to error out in case the correct GDB binary is not found. Thoughts? Luis