diff <(cut -d: -f1 passwd2 | sort) <(sort aix_old)
dá:
4,5c4
< harry
< henry
---
> ftp
7,8c6,7
< jennifer
< julie
---
> joe
> juliet
diff -y <(cut -d: -f1 passwd2 | sort) <(sort aix_old)
dá:
amadeus amadeus
bill bill
charlie charlie
harry | ftp
henry <
image image
jennifer | joe
julie | juliet
romeo romeo
Do wiki de subestituição do processo: link
The Unix diff command normally accepts the names of two files to compare, or one file name and standard input. Process substitution allows you to compare the output of two programs directly:
$ diff <(sort file1) <(sort file2)
The
<(command)
expression tells the command interpreter to run command and make its output appear as a file. The command can be any arbitrarily complex shell command.