未找到 wget -O 命令

未找到 wget -O 命令

这是我使用 Ubuntu 12.04 的第一天。我之所以使用 Ubuntu,是因为它是唯一能够托管我使用统计软件包 R 创建的应用程序的操作系统。我尝试遵循以下网站提供的(迄今为止非常有用的)命令:

http://withr.me/blog/2013/07/23/configure-shiny-server-under-ubuntu/

一切运行正常,直到第 6 步 - “安装 Upstart 脚本”。

sudo wget\
https://raw.github.com/rstudio/shiny-server/master/config/upstart/shiny-server.conf\
-O /etc/init/shiny-server.conf

command not found

如果能帮助我解释为什么会出现此错误信息,我将不胜感激。抱歉,这个问题是新手问的。说实话,我只用了几个小时的 Linux。

答案1

用这个:-)

sudo wget -O /etc/init/shiny-server.conf  https://raw.github.com/rstudio/shiny-server/master/config/upstart/shiny-server.conf

您可能在 \ 之后有一个多余的空格,或者忘记在它之前留一些空间。无论如何,这一行都可以起作用。

答案2

好的,让我们解释一下为什么会得到command not found。您告诉sudo要做的是执行wget\不存在的命令。如果您将 分开,wget\会发现它会很好地工作:

sudo wget \
https://raw.github.com/rstudio/shiny-server/master/config/upstart/shiny-server.conf \
-O /etc/init/shiny-server.conf

第二行也是一样。如果你愿意,你可以把它变成一行,删除回车符和反斜杠 ( \):

sudo wget https://raw.github.com/rstudio/shiny-server/master/config/upstart/shiny-server.conf -O /etc/init/shiny-server.conf

这就是它不起作用的原因

相关内容