找不到安装sh文件命令

时间:2018-07-25 20:24:12

标签: linux ssh raspberry-pi raspberry-pi3

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

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

1 个答案:

答案 0 :(得分:0)

您获得说明的网站出于某种原因在文章中的每个链接后均显示一个数字。结果,您的URL末尾有一个错误的数字,当您尝试访问URL时,从GitHub收到404错误“找不到”。 Curl正在将单词“ Not found”写入其输出文件,而您试图将生成的文件作为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

相关问题