1

This question already has an answer here:

I was reading this script someone wrotte and there is this line:

comm -23 <(grep cat access.log) cats | mailx -s subject address@gmail.com

I understand it to mean convert this output as if it was a file but I just don't understand this syntax and I haven't seen it anywhere else.

Does this mean, execute grep in a sub shell and pipe the output back?

marked as duplicate by cuonglm bash Feb 13 '16 at 11:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

< is a redirection operator. It takes the contents of the file/output from the right and pass it to the command to the left.

  • 1
    No, that's process substitution, not redirection. – cuonglm Feb 13 '16 at 11:51
  • yep, a redirection through < from a different process to the stdin of another process..which is same as saying the whole thing is a process substitution through a redirection. – Khawar Feb 13 '16 at 11:57
  • No, there's no redirection there. Process substitution make the output of grep as a file, then comm read from that file. Try echo <(:) for example. – cuonglm Feb 13 '16 at 12:05
  • See also unix.stackexchange.com/questions/156084/… – cuonglm Feb 13 '16 at 12:11
  • @cuonglm thank you, that answer was great. And sorry for double posting, hard to search in google for this question and get what you are looking for. – Ulukai Feb 16 '16 at 9:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.