Пожалуйста, объясните мне, что означает эта команда:
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
wget
- используйте wget для загрузки чего-либо -qO-
первый аргумент -q, но что значит 0-
? почему после него стоит тире? | sh
- что-то о трубе, но что именно? Да, я читаю man wget.
* 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 в единственной команде.
-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
.