在非root用户下 写了一个shell脚本   通过手动执行shell脚本  sh -x script.sh  可以正常输出 当把该脚本加入到crontab中后  定时任务有调用.但不会输入结果

    

                      需要在脚本中增加。

#!/bin/bash
. /etc/profile
. ~/.bash_profile

在SUSE 中 使用已下行

if [ -f ~/.profile ];
then
  . ~/.profile
fi

相关文章:

  • 2021-08-29
  • 2021-12-18
  • 2022-01-15
  • 2021-11-03
  • 2021-06-12
  • 2022-12-23
  • 2022-02-03
猜你喜欢
  • 2022-02-10
  • 2021-12-08
  • 2021-12-08
  • 2022-01-26
  • 2022-12-23
相关资源
相似解决方案