【问题标题】:Help with basic shell script. /bin/sh: source: not found帮助基本的 shell 脚本。 /bin/sh:来源:未找到
【发布时间】:2011-02-27 20:33:15
【问题描述】:

我的计划:

45 10 * * * source /home/ThinkCode/Test/hello.sh

你好.sh:

#!/bin/bash
echo "helloworld"

它通过电子邮件发送给我的错误:

/bin/sh: source: not found

我做错了什么?它是特定于配置/环境的,所以谷歌搜索并没有太大帮助!谢谢..

【问题讨论】:

    标签: bash shell cron


    【解决方案1】:

    真正的sh 没有source,只有.。要么将 cron 中的 shell 更改为 bash,要么改用 .

    【讨论】:

    • 您可以通过以下方式执行此操作:SHELL=/bin/bash
    【解决方案2】:

    你为什么sourceing 来自 cron 的文件。为什么不直接执行呢?

    【讨论】:

      猜你喜欢
      • 2015-06-13
      • 2012-05-22
      • 2013-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-25
      • 2011-06-11
      • 2019-12-24
      相关资源
      最近更新 更多