在sh shell中找不到源命令 [英] source command not found in sh shell
问题描述
我有一个使用sh
shell的脚本.在使用source
命令的行中出现错误.看来source
没有包含在我的sh
shell中.
I have a script that uses sh
shell. I get an error in the line that uses the source
command. It seems source
is not included in my sh
shell.
如果我明确尝试从shell运行source
,我会得到:
If I explicitly try to run source
from shell I get:
sh: 1: source: not found
我应该以某种方式安装源代码"吗?我的sh
版本是否错误?
Should I somehow install "source"? Do I have a wrong version of sh
?
推荐答案
/bin/sh
通常是其他一些试图模仿Shell的shell.许多发行版对sh
使用/bin/bash
,它支持source
.但是,在Ubuntu上,使用不支持source
的/bin/dash
.大多数shell使用.
而不是source
.如果您无法编辑该脚本,请尝试更改运行该脚本的外壳.
/bin/sh
is usually some other shell trying to mimic The Shell. Many distributions use /bin/bash
for sh
, it supports source
. On Ubuntu, though, /bin/dash
is used which does not support source
. Most shells use .
instead of source
. If you cannot edit the script, try to change the shell which runs it.
这篇关于在sh shell中找不到源命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!