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..?
To unset an environment variable from Command Prompt, type the command setx variable_name “”. For example, we typed setx TEST “” and this environment variable now had an empty value.
The dsadmin command can be used for deleting an environment variable in a particular project.
Running a program that demands a terminal via cron
can lead to problems; it won't have a terminal when it is run by cron
.
In case of doubt, though, ensure that the variable is set in the script, by adding a line:
export TERM=${TERM:-dumb}
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 about TERM
not being set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With