I have main.sh
and external.awk
files.
They are in the same directory.
From main.sh
I am calling that external awk script like this:
awk -f external.awk ..
and of course it is working.
Now when I do:
cd /usr/local/bin
sudo ln -s /path/to/scripts/dir/main.sh main.sh
sudo ln -s /path/to/scripts/dir/external.awk external.awk
I can call my main.sh
from whatever directory I am in.
But it gives me error on not being able to find external.awk
script.
Why linking does not work in this case, shouldn't that
awk -f external.awk ..
call external.awk
relative to folder where it is, thus in this case calling
that symbolic link which is in /usr/local/bin
path?
EDIT
Soon after posting my question, I found this as a good way to handle this situation:
https://www.gnu.org/software/gawk/manual/html_node/AWKPATH-Variable.html
It is not POSIX compliant, but in this case it is not of an importance to me.