CentOS 8 /bin/sh: 第 1 行: a: 没有那个文件或目录
CentOS 8 /bin/sh: line 1: a: No such file or directory
获得我的 CentOS 8 VPS,以 root 身份登录并想要 运行 命令 curl install.meteor.com | /bin/sh
但得到 /bin/sh: line 1: a: No such file or directory
所以我发现/bin/sh
位于系统目录“/”下,所以尝试../bin/sh
没有用。
检查文件编码,发现它是二进制的,即 head -1 ../bin/sh
无法检查第 1 行中的拼写错误。
我如何运行这个命令?从根目录 运行 它是否正确?当 /home/<userName>
运行 时,我得到了同样的错误。请看终端图片。谢谢
更新:
正确的命令应该是 curl https://install.meteor.com/ | sh
而不是从非 meteor 网站复制的 curl install.meteor.com | /bin/sh
。
看看你从curl
命令中实际得到了什么:
$ curl install.meteor.com
<a href="https://install.meteor.com/">Moved Permanently</a>.
<a
被 shell 解释为输入重定向,但是没有名为 a
的文件可供读取。
正如您所注意到的,您需要使用 https
URL 来执行实际的 shell 脚本。 /bin/sh
或 sh
都应该工作,因为 sh
通常 安装在 /bin
.
获得我的 CentOS 8 VPS,以 root 身份登录并想要 运行 命令 curl install.meteor.com | /bin/sh
但得到 /bin/sh: line 1: a: No such file or directory
所以我发现/bin/sh
位于系统目录“/”下,所以尝试../bin/sh
没有用。
检查文件编码,发现它是二进制的,即 head -1 ../bin/sh
无法检查第 1 行中的拼写错误。
我如何运行这个命令?从根目录 运行 它是否正确?当 /home/<userName>
运行 时,我得到了同样的错误。请看终端图片。谢谢
更新:
正确的命令应该是 curl https://install.meteor.com/ | sh
而不是从非 meteor 网站复制的 curl install.meteor.com | /bin/sh
。
看看你从curl
命令中实际得到了什么:
$ curl install.meteor.com
<a href="https://install.meteor.com/">Moved Permanently</a>.
<a
被 shell 解释为输入重定向,但是没有名为 a
的文件可供读取。
正如您所注意到的,您需要使用 https
URL 来执行实际的 shell 脚本。 /bin/sh
或 sh
都应该工作,因为 sh
通常 安装在 /bin
.