I am having a script runonce.sh who calls another script setup.sh through cron. We consider this case as ideal case where "TERM environment variable not set." is seen in output of runonce.sh script.
Now I am facing a problem that another third simple script - upgradeAndTest.sh when calls setup.sh, that time also "TERM environment variable not set." is seen in output of upgradeAndTest.sh script. Why is so..?
Also, if I redirect stderr of setup.sh to stdout in calling script then also "TERM environment variable not set." displays on console.
Can any one help me to remove this line from stdout of calling script..?
Running a program that demands a terminal via
cron
can lead to problems; it won't have a terminal when it is run bycron
.In case of doubt, though, ensure that the variable is set in the script, by adding a line:
If the environment variable
TERM
is already set, this is a no-op. If it is not, it sets the terminal to a standard one with minimal capabilities — this satisfies the program that complains aboutTERM
not being set.