< tput:$ TERM没有值,也没有指定-T. CRON进程记录的错误 [英] "tput: No value for $TERM and no -T specified " error logged by CRON process

查看:163
本文介绍了< tput:$ TERM没有值,也没有指定-T. CRON进程记录的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个由CRON运行的shell脚本. Shell脚本依次运行python脚本,该脚本从FTP服务器下载文件,然后在这些文件上运行java日志处理器.该过程运行得很好,除了即使没有错误我也不断收到CRON电子邮件.至少,我认为没有错误. Cron电子邮件有两行,其中一行是

We have a shell script which is run by CRON. The shell script in turn runs a python script which downloads files from an FTP server and then runs a java log processor on those files. The process runs just fine, except that I keep on getting CRON emails even if there is no error. At least, I think there is no error. The cron email has two lines, out of which one of the lines is

tput: No value for $TERM and no -T specified

经过一些研究,我发现这与设置$ TERM变量有关.我不确定如何做到这一点.任何帮助,将不胜感激.谢谢!

After researching a bit, I found that it's something to do with setting the $TERM variable. I am not sure, how to do that. Any help would be appreciated. Thanks!

推荐答案

脚本中的某些内容正在调用tput二进制文件. tput尝试检查$TERM变量以确定当前端子,以便它可以产生正确的控制序列. cron运行时没有终端,因此您可以从tput收到该错误.

Something in the script is calling the tput binary. tput attempts to inspect the $TERM variable to determine the current terminal so it can produce the correct control sequences. There isn't a terminal when cron is runninng so you get that error from tput.

您可以手动为cron作业分配一个TERM值(可能是dumb或类似的值),或者(这可能是更好的解决方案),您可以找出调用tput的内容并删除那个电话.

You can either manually assign a TERM value to the cron job (likely dumb or something similar to that) or (and this is likely the better solution) you can find out what is calling tput and remove that call.

这篇关于< tput:$ TERM没有值,也没有指定-T. CRON进程记录的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆