Click to See Complete Forum and Search --> : help with a shell script


PhatBarren
12-01-2001, 10:57 PM
hello.
i have a shell script that has a line:

./myexecutable

in it. It works fine when i execute the scrip using ./myshellscript from the directory where the script and myexecutable are both located. But, I want to execute it using cron, and i get mail from the cron daemon saying:

./myexecutable: not found

I think it's because i must use an absolute path but i'm not sure exactly what to put...

Any suggestions??

knute
12-01-2001, 11:53 PM
Have you tried putting the entire path to it in the cron job?

Instead of ./, which to cron would mean most likely something along the lines of /, or /etc, or even /temp and probably changes from time to time, :eek: try for example /home/username/subdirectory/anothersubdirectory/fillerspace/myexecutable as the path rather than simply saying it's in the current working directory.

ph34r
12-02-2001, 12:19 AM
When the script runs

./executable

it assumes that everything is in the same directory. So you need to change the script to point to the full path of said executable.

/usr/local/bin/runme

PhatBarren
12-02-2001, 12:47 AM
thanks :)
i thought that was what i was looking for, i just didn't know the syntax
PEACE