I have a script that works perfectly if I execute it from the command line manually. However, when it runs via cron, the job fails with the following error:
/usr/bin/env: escript: No such file or directory
The first line in the script is:
#!/usr/bin/env escript
The only thing I can figure is that escript is not being found, and that is because it is not installed in /usr/bin, but in a sub-directory of the user's home directory.
My understanding--perhaps misunderstanding--of cron is that cron runs each job in a user's crontab under the UID/GID of the user. Should it also not inherit the PATH variable from the user as well? Must everything be specified as absolute paths?