On Fri, 2004-11-12 at 16:07 +0100, Silvan Villiger wrote:
> 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?

If I understand you correctly, you could either:
1. use absolute path names
     or
2. symbolically link (aka symlink) the scripts in /progpath/scripts/
   into /usr/local/bin
     or
3. put /progpath/scripts in your PATH.

-- 
-----------------------------------------------------------------
Ron Johnson, Jr.
Jefferson, LA USA
PGP Key ID 8834C06B

"Peace, in international affairs, is a period of cheating between
two periods of fighting."
Ambrose Bierce

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to