Tentando descobrir o que o comando significa

1

Por favor, me explique o que esse comando significa:

wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
  1. wget - use o wget para fazer o download de algo
  2. -qO- primeiro argumento é -q, mas o que significa 0- ? por que tem um pouco depois disso?
  3. | sh - algo sobre pipe, mas o que exatamente?

Sim, eu li man wget.

    
por アレックス 06.03.2014 / 06:08

3 respostas

1

-q
      --quiet
          Turn off Wget's output.

-O file
      --output-document=file
          The documents will not be written to the appropriate files, but all
          will be concatenated together and written to file.  If - is used as
          file, documents will be printed to standard output, disabling link
          conversion.  (Use ./- to print to a file literally named -.)

sh
      The shell is a command that reads lines from either a file or the terminal,
      interprets them, and generally executes other commands. 

O caractere de pipe de linha vertical antes do sh canaliza a saída de -O- (saída padrão para o terminal) para o comando sh que diz para executar o arquivo que foi baixado no terminal como um programa, supondo que o O arquivo que foi baixado primeiro tem suas permissões definidas para permitir a execução do arquivo como um programa.

Para definir as permissões para permitir a execução de um arquivo como um programa: clique com o botão direito no arquivo, selecione Propriedades para abrir a janela Propriedades e em Propriedades selecione as Permissões e coloque uma marca de seleção à esquerda de onde diz: Permitir a execução do arquivo como programa .

    
por karel 06.03.2014 / 06:31
1

-q executa o wget no modo silencioso.

 -O file
       --output-document=file
           The documents will not be written to the appropriate files, but all
           will be concatenated together and written to file.  If - is used as
           file, documents will be printed to standard output, disabling link
           conversion.  (Use ./- to print to a file literally named -.)

sh é o shell Bourne. Existem várias conchas, das quais Bourne é o antigo padrão.

Seu comando acima está dizendo para executar wget no modo silencioso ( -q ) e porque a saída ( O ) leva - , em vez de fornecer um arquivo como destino, os documentos serão impressos na saída padrão desativar a conversão de links. Em seguida, o uso do canal | inicia sh .

    
por Kai 06.03.2014 / 06:27
0

* wget:     The non-interactive network downloader

* -q (--quit):    Turn off Wget's output.

* -O file (--output-document=file):    The documents will not be written to the appropriate files, but all will be concatenated together and written to file.  If - is used as file, documents will be printed to standard output, disabling link conversion.  

* URL https://toolbelt.heroku.com/install-ubuntu.sh     wget [option]... [URL]...

* | Pipelines
    A  pipeline is a sequence of one or more commands separated by one of the control operators | or |&.  The
    format for a pipeline is:

           [time [-p]] [ ! ] command [ [|⎪|&] command2 ... ]

    The standard output of command is connected  via  a  pipe  to  the  standard  input  of  command2.


* sh  command interpreter (shell)

Em geral, este comando irá apenas baixar o script chamado install-ubuntu.sh da URL dada e então passar para o pipeline para ser como entrada para o próximo comando que é sh. Assim, isto irá instalar e executar o script chamado install-ubuntu.sh em um único comando.

    
por Maythux 06.03.2014 / 09:18