Попытка выяснить, что означает команда

Пожалуйста, объясните мне, что означает эта команда:

wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
  1. wget - используйте wget для загрузки чего-либо
  2. -qO- первый аргумент -q, но что значит 0-? почему после него стоит тире?
  3. | sh - что-то о трубе, но что именно?

Да, я читаю man wget.

1
задан 15.05.2020, 07:30

2 ответа


* 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)

В полном эта команда просто загрузит сценарий, названный установкой-ubuntu.sh от данного URL, и затем передаст конвейеру, который будет как введен к следующей команде, которая является sh. Таким образом это установит и выполнит сценарий, названный установкой-ubuntu.sh в единственной команде.

0
ответ дан 15.05.2020, 07:31

-q выполнения wget в тихом режиме.

 -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 Оболочка Bourne. Существует несколько оболочек, из которых Bourne является старым стандартом.

Ваша команда выше говорит для выполнения wget в тихом режиме (-q) и потому что произведенный (O) берет -, вместо того, чтобы обеспечить файл как место назначения, документы будут распечатаны к стандартному выводу, отключая преобразование ссылки. Тогда использование канала | запускается sh.

0
ответ дан 15.05.2020, 07:32

Теги

Похожие вопросы