Я вижу, что на некоторых страницах Linux написано, как установить ключ:
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
Что такое «-O -» в wget?
Кажется, это связано с «add -». [ 113]
Как это работает?
Спасибо ~
Я использовал **, чтобы указать, что это важно. из 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 -.**
это объясняет вашу команду.
Опция -O -
печатает загруженный файл на стандартный вывод (вместо обычного файла), а опция -
в apt-key
считывает со стандартного ввода. Команда эквивалентна двум командам:
wget http://packages.ros.org/ros.key
sudo apt-key add ros.key
Когда вы объединяете обе команды, вам не нужно беспокоиться о сохранении файла, и обычно команда короче.