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

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

问题描述

我们有一个由 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 running 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 没有值,也没有指定 -TCRON 进程记录的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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