bash - 帮助基本的 shell 脚本。/bin/sh : source: not found

标签 bash shell cron

我的计划:

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

你好.sh :

#!/bin/bash
echo "helloworld"

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

/bin/sh: source: not found

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

最佳答案

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

关于bash - 帮助基本的 shell 脚本。/bin/sh : source: not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2975370/

相关文章:

node.js - 生成文件: How to runs 2 distinct shells?

linux - 在 VI/Linux 中替换反斜杠加管道

linux - 捕获 bash 命令的输出,解析它并存储到不同的 bash 变量中

linux - 在给定命令行参数的情况下循环遍历不同目录中的文件

postgresql - 在 cron 中备份 postgres 数据库的问题

google-app-engine - 无法使用 appengine/log 找到日志

linux - Jenkins 中的什么目录 shell 命令执行?

linux - 如何列出具有非挂起链接的目录中的所有符号链接(symbolic link)?

linux - 统计最近 7 天内文件中出现的次数

linux - 带有 flock 的简单 cron 无法在 Ubuntu 上运行