在sh shell中找不到源命令 [英] source command not found in sh shell

查看:111
本文介绍了在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屋!

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