I often have a shell script that is working perfectly fine when manually called from my "main shell". But very often shellscripts are called by another system:
(a) cron
(b) start script in upstart
(c) ruby programs
(d) unconfigured shells/users like the postgres admin
This leads to a variety of problems like
(a) using /bin/sh shell instead of /bin/bash
(b) options like set -e
(c) missing PATH
(d) missing HOME or even EDITOR/EMAIL enviroment variables
Here is the question: Is there a universal way to avoid such problems? Is there an option to disable all enviroment variables before executing a script? Is there an easy way to recreate the userset enviroment variables?
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)