cat list1 list2 list3 | sort | uniq > list123 &
cat list4 list5 list6 | sort | uniq > list456 &
wait #Doen’t execute the next command until subshells finish
diff list123 list456
Note1: If no argument is specified, wait waits until all processes (started with &) of the current shell have completed, and reports on abnormal terminations.
Note2: Because the wait() system call must be executed in the parent process, the shell itself executes wait without creating a new process.
Happy Reading & Sharing!