Какова функция wget -O -?

Я вижу, что на какой-то странице Linux говорится, как установить ключ:

  wget http://packages.ros.org/ros.key -O - | sudo apt-key add -

Что такое «-O» в wget?

Кажется, что это связано с «add-» .

Как это работает?

Спасибо ~

1
задан 10 January 2013 в 12:32

1 ответ

Я использовал **, чтобы указать, что это важно. из man 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 -.) **

       Use of -O is not intended to mean simply "use the name file instead
       of the one in the URL;" rather, it is analogous to shell
       redirection: wget -O file http://foo is intended to work like wget
       -O - http://foo > file; file will be truncated immediately, and all
       downloaded content will be written there.

и из man apt-key

add filename
       Add a new key to the list of trusted keys. The key is read from
       filename, or ** standard input if filename is -.**

это объясняет вашу команду.

5
ответ дан 25 May 2018 в 02:35

Другие вопросы по тегам:

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