Как я могу использовать comm таким образом?

В CentOS 7.2.1511 мне удалось установить его через репозиторий EPEL:

$ yum install epel-release -y
$ yum install aria2 -y
1
25.04.2017, 01:31
1 ответ

Подстановка процессов здесь вам в помощь:

$ comm -23 <(find /dir -name 'something') <(cut -c43- list)

Формат <(command)применяет дескриптор временного файла к command, и весь <( )используется в качестве файлового ввода дляcomm(или любой другой команды ).
Подробнее о подстановке процессов см. здесь . Также проверьтеman bash:

Process Substitution
Process substitution allows a process's input or output to be referred to using a filename. It takes the form of <(list) or >(list). The process list is run asynchronously, and its input or output appears as a filename. This filename is passed as an argument to the current command as the result of the expansion. If the >(list) form is used, writing to the file will provide input for list. If the <(list) form is used, the file passed as an argument should be read to obtain the output of list. Process substitution is supported on systems that support named pipes (FIFOs) or the /dev/fd method of naming open files.

4
27.01.2020, 23:19

Теги

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