帮助使用基本的 shell 脚本./bin/sh: 来源:未找到 [英] Help with basic shell script. /bin/sh: source: not found

查看:30
本文介绍了帮助使用基本的 shell 脚本./bin/sh: 来源:未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的计划:

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

hello.sh :

#!/bin/bash
echo "helloworld"

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

The error it emails me :

/bin/sh: source: not found

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

What am I doing wrong? It is configuration/environment specific, so Googling didn't help much! Thanks..

推荐答案

真正的sh没有source,只有..将 cron 中的 shell 更改为 bash,或者使用 . 代替.

Real sh doesn't have source, only .. Either change the shell in cron to bash, or use . instead.

这篇关于帮助使用基本的 shell 脚本./bin/sh: 来源:未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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