linux - 在linux命令行中找不到sh文件

标签 linux command-line steam

我是在特殊操作系统(主要是 linux)上运行的 synology diskstation NAS 服务器的所有者

它只能从互联网访问。我建立了命令行界面来使用 synology wiki 访问它。现在我尝试使用 SteamCMD 在其上安装 Counter-Strike 服务器。我只是在 Valve 开发者社区中寻找它。

我正在写下一个:

mkdir csServer  
cd csServer
wget http://media.steampowered.com/client/steamcmd_linux.tar.gz
tar xvfz steamcmd_linux.tar.gz
./steamcmd.sh

但最后一行导致 -sh: ./steamcmd.sh not found。但是,我可以在目录中看到这个文件。

enter image description here

究竟是什么导致了它?

//已添加

该文件是可执行的!

enter image description here

最佳答案

您的脚本包含一个 header ,上面写着 #!/bin/bash,即使用/bin/bash 执行此脚本。显然,在您的系统上 /bin/bash 不存在。我不熟悉 Synology 环境,但您应该能够通过安装 bash 然后将您的脚本指向正确的路径来解决这个问题,该路径应该是 /opt/bin/bash。因此,脚本的第一行应如下所示

#!/opt/bin/bash

您也可以使用 Synology 默认的 ash,但请注意您的脚本可能无法正常工作,因为它是为 bash 编写的。

关于linux - 在linux命令行中找不到sh文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27191672/

相关文章:

linux - shell 脚本 : how to output to command line?

command-line - win 7中的MSMQ命令行

steam - 从服务器获取玩家列表

javascript - Nodejs Steam 交易报价管理器不进行轮询

linux - -t 选项不能在 iptables-restore 中使用

linux - 多行变量中导出的含义是什么

使用 jaxb api 的 java 类在带有 : Provider com. sun.xml.bind.v2.ContextFactory 的 jira 中未找到

linux - Centos 6.7 x86_64 : Can you help me figure out this error?

linux - 如何从 proc 文件中读取大数据?

asp.net - Steam获取用户的电子邮件地址