【问题标题】:Install sh file command not found找不到安装 sh 文件命令
【发布时间】:2018-07-25 20:24:11
【问题描述】:

您好,我是 100% 的 linux 和 ssh 新手。我目前无法在我的树莓派 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

【问题讨论】:

    标签: linux ssh raspberry-pi raspberry-pi3


    【解决方案1】:

    出于某种原因,您从中获得说明的网站会在文章中的每个链接后面显示一个数字。结果,您的 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

    【讨论】:

    • 我确保检查更新的文件,因为我建议所有找到这篇文章的人都这样做。谢谢。
    猜你喜欢
    • 2022-06-14
    • 2014-09-21
    • 1970-01-01
    • 2019-04-12
    • 2021-07-07
    • 2019-08-10
    • 1970-01-01
    • 2021-11-13
    • 2019-04-19
    相关资源
    最近更新 更多