Say we have a shell script that refer to relative paths for files/directories:
for example:
These type of file works fine when we issue it from the command line, but when we register it as a crontab, it seems that the files/directories have to be referred to absolute path.
It is easy to change this script since its small, but what if we have a really large shell script and all of it is implemented with relative references. Is there another optino than to check every line and make it absolute?
for example:
Code:
#!/bin/sh
cp thisfile ../thatfile
cd mydir
These type of file works fine when we issue it from the command line, but when we register it as a crontab, it seems that the files/directories have to be referred to absolute path.
It is easy to change this script since its small, but what if we have a really large shell script and all of it is implemented with relative references. Is there another optino than to check every line and make it absolute?