Spoofing paths.

There is a program that I am trying to run on a shell account. It depends on another program, which I have also copied to the shell account. Both are in my home directory, yet the first program has a different path hardcoded into it, which I cannot use because of permissions problems.

How can I trick the first program into running the second one from a different path?

chroot, but it sounds like alot of overkill.

The whole reason I was trying to spoof the path was because I didn't have root - are there any alterenatives that can be run as a standard user please?

Thank you for your help.

Try modifying the PATH variable. if you are calling script2 from script1 like this

$> cat script1.sh
#!/bin/ksh
export PATH=/some/user/dir
script2.sh args

then, changing PATH wont be a solution. If the PATH is not set in the script1.sh before calling script2.sh like

$> cat script1.sh
#!/bin/ksh
script2.sh args

then try this

$> export PATH=.:$PATH
$> which script2.sh -->check if this is pointing to the correct script
$> script1.sh --> this should call the required script2.sh

I hope I understood the requirement clearly!!!