linux - 找不到安装sh文件命令

标签 linux ssh raspberry-pi raspberry-pi3

嗨,我对 linux 和 ssh 是 100% 的新手。我目前无法在我的 raspberry pi 3 上通过 ssh 运行命令。我安装的操作系统是 OSMC。我一直遵循此处列出的说明:https://zatarranl.wordpress.com/2017/01/08/howto-setup-a-spotify-connect-web-server-on-a-raspberry-pi-with-osmc/我已经到了第四步。这就是我遇到麻烦的地方。列出的命令:

curl -O curl -OL https://github.com/Fornoth/spotify-connect- 
web/releases/download/0.0.3-alpha/spotify-connect-web.sh3
chmod u+x spotify-connect-web.sh
./spotify-connect-web.sh install

除非我将对sh文件的引用从spotify-connect-web.sh更改为spotify-connect-web.sh3,否则第一个命令之后的所有命令都不起作用。最后一个命令似乎仍然不起作用。执行时它给我这个错误消息:

 ./spotify-connect-web.sh3: line 1: Not: command not found

最佳答案

由于某种原因,您从中获取说明的网站在文章中的每个链接后面显示了一个数字。因此,您的 URL 末尾有一个错误的数字,并且当您尝试访问该 URL 时,您会从 GitHub 收到 404“未找到”错误。 Curl 正在将“未找到”一词写入其输出文件,并且您尝试将生成的文件作为 shell 脚本执行:

bash-3.2$ curl -O curl -OL https://github.com/Fornoth/.../spotify-connect-web.sh3
curl: Remote file name has no length!
curl: try 'curl --help' or 'curl --manual' for more information
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     9    0     9    0     0     44      0 --:--:-- --:--:-- --:--:--    44
bash-3.2$ ls
spotify-connect-web.sh3
bash-3.2$ cat spot*
Not Found

从末尾删除“3”会产生您可能期望的结果:

bash-3.2$ curl -O curl -OL https://github.com/Fornoth/.../spotify-connect-web.sh
                                                                                ^- no "3"
curl: Remote file name has no length!
curl: try 'curl --help' or 'curl --manual' for more information
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   612    0   612    0     0   2334      0 --:--:-- --:--:-- --:--:--  2335
100   531  100   531    0     0   1050      0 --:--:-- --:--:-- --:--:--  1050
bash-3.2$ ls
spotify-connect-web.sh
bash-3.2$ head spot*
#!/bin/bash
set -e

DIR=~/spotify-connect-web-chroot
...

我还会注意到,您尝试下载的 spotify-connect-web 脚本版本已过期。请参阅this page .

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

相关文章:

linux - Rpm 构建 : Bad exit status from/var/tmp/rpm-tmp. hI2V3W (%install)

C++ 获取 linux 发行版名称\版本

git - 在远程服务器上创建项目并在 JetBrains PhpStorm 中使用远程服务器上的 Git

ssh - 无法使用 Putty 访问 SSH 到 Arvixe 共享主机

linux - crontab 在重新启动时不启动命令

linux - 在Fedora 19中直接打开Play Framework

linux - 适合awslogs的datetime_format配置上传audit.log

git - git bash 中的 ssh 客户端在哪里存储它在 Windows 上的 known_hosts 文件?

c - valgrind 无法识别树莓派中的 memcmp 指令

docker - docker 中的特权模式组合成一个群