[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

linking to scripts



Hi,

I've written some scripts for a program and encountered a problem which I'll try to explain simplified. Let's assume that my program is in the directory /progpath/ and I have 2 scripts in /progpath/scripts/. script1 calls script2 and I call script1 from /progpath/data/ because this is the place for the data the scripts should operate on. The problem is, that when i call script2 with ./script2 in script1 he will not find script2, because I called script1 from /../data/ where he tries now to find script2. I know, that I could call script2 from script1 with ../scripts/script2, but that's not very nice, because then, there are errors when i call script1 from any other directory :-).

What do you suggest me to do? I'm new to linux and don't understand all the linking stuff. But could I include my scripts in PATH in order to execute them with simply writing e.g. script1 as it is possible with all the programs in linux? And how would I do that if this would be a good solution? Or is my partitioning into /scripts and /data a bad idea at all? How would you partitioning the files then?

Thank you for helping me!

Greetings...       Silvan



Reply to: