Darren Freeman wrote: > > I'd have to actually try it, but if the shell script is located in the > lyx directory but the user is currently elsewhere, then I expect ./lyx > to be looking where the user is, not where the script is. Unless sh > changes directory automatically to where the script is, but my > experience so far was that ./lyx-trace = where I am now, so ./lyx is > also referring to where I am now. Whereas $0 is the full path to the > script being run so it can be used to find files in the same dir as the > script. You don't need to search ./lyx and ./src/lyx if you know that > the script is definitely in src/lyx already (or in my case, linked from > there). > > Play with it, I think I'm right =)
Yes, you are. I apologize for causing confusion. Though I would suggest not to place the lyxdbg script in src/lyx, but elsewhere. src/ has the source code; the script should be somewhere else. Maybe in the lyx-devel root directory? In that case you may want `dirname $0`/src/lyx in the for-loop. But as long as the script is not (yet) accepted into CVS, this is not an important issue. > You do seem to assume that I cd to the lyd directory tree before running > the script. But the way I've been using it, I cd to where my documents > are before running lyxdbg. Yes, I assumed that, because that's how I use the CVS build. Anyway, your use is also legitimate and using dirname above should solve that problem. Cheers, Rob. PS: wonder if someone else has noticed the charm of your script!?!