wget命令无法正常工作

时间:2013-07-10 23:12:17

标签: github wget

所以我在这个链接上添加了一个设置脚本到我自己的仓库: https://github.com/quinnliu/Install_Scripts/blob/master/install_node_and_NPM

但是当我输入wget时,我得到的文件名正确,但是有一大堆.html代码而不是install命令。任何人都知道为什么?

这是我得到的文件的开头:

<!DOCTYPE html>
<html>
  <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# githubog: http://ogp.me/ns/fb/githubog#">
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Install_Scripts/install_node_and_NPM at master <C2><B7> quinnliu/Install_Scripts <C2><B7> GitHub</title>
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub" />
<link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub" />
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-114.png" />

2 个答案:

答案 0 :(得分:0)

您可能想要下载raw file

答案 1 :(得分:0)

如前所述,您需要原始链接

$ wget -qO- raw.github.com/quinnliu/Install_Scripts/master/install_node_and_NPM

#!/bin/bash

sudo apt-get update

# Install a special package
$ sudo apt-get install -y python-software-properties python g++ make

# Add a new repository for apt-get to search
$ sudo add-apt-repository ppa:chris-lea/node.js

# Update apt-get's knowledge of which packages are where
$ sudo apt-get update

# Now install nodejs and npm
sudo apt-get install -y nodejs
sudo apt-get install npm