Skip to main content
added 22 characters in body
Source Link
Gilles Quénot
  • 36.8k
  • 7
  • 76
  • 97

<<< is a here strings. Similar to here documents: The word after <<< and a newline are passed to the standard input of a command. Syntax: command <<< "some sentence" (Like echo "some sentence" | command, but without the overhead of the subshell)


Command Substitution: "$(cmd "foo bar")" causes the command 'cmd' to be executed with the argument 'foo bar' and "$(..)" will be replaced by the output. See http://mywiki.wooledge.org/BashFAQ/002 and http://mywiki.wooledge.org/CommandSubstitution


Process Substitution: <(command) or >(command) is replaced by a FIFO or /dev/fd/* entry. Basically shorthand for setting up a named pipe. See http://mywiki.wooledge.org/ProcessSubstitution Example: diff -u <(sort file1) <(sort file2)


command < <(othercommand) # Same thing as othercommand | command but without subshelling 'command'. Uses file redirection (<) to redirect a file created by process substitution (<()). The space between < and <(..) is important to avoid ambiguity (is it a heredoc, is it a redirected PS?).

<<< is a here strings. Similar to here documents: The word after <<< and a newline are passed to the standard input of a command. Syntax: command <<< "some sentence" (Like echo "some sentence" | command, but without the overhead of the subshell)


Process Substitution: <(command) or >(command) is replaced by a FIFO or /dev/fd/* entry. Basically shorthand for setting up a named pipe. See http://mywiki.wooledge.org/ProcessSubstitution Example: diff -u <(sort file1) <(sort file2)


command < <(othercommand) # Same thing as othercommand | command but without subshelling 'command'. Uses file redirection (<) to redirect a file created by process substitution (<()). The space between < and <(..) is important to avoid ambiguity (is it a heredoc, is it a redirected PS?).

<<< is a here strings. Similar to here documents: The word after <<< and a newline are passed to the standard input of a command. Syntax: command <<< "some sentence" (Like echo "some sentence" | command, but without the overhead of the subshell)


Command Substitution: "$(cmd "foo bar")" causes the command 'cmd' to be executed with the argument 'foo bar' and "$(..)" will be replaced by the output. See http://mywiki.wooledge.org/BashFAQ/002 and http://mywiki.wooledge.org/CommandSubstitution


Process Substitution: <(command) or >(command) is replaced by a FIFO or /dev/fd/* entry. Basically shorthand for setting up a named pipe. See http://mywiki.wooledge.org/ProcessSubstitution Example: diff -u <(sort file1) <(sort file2)


command < <(othercommand) # Same thing as othercommand | command but without subshelling 'command'. Uses file redirection (<) to redirect a file created by process substitution (<()). The space between < and <(..) is important to avoid ambiguity (is it a heredoc, is it a redirected PS?).

Source Link
Gilles Quénot
  • 36.8k
  • 7
  • 76
  • 97

<<< is a here strings. Similar to here documents: The word after <<< and a newline are passed to the standard input of a command. Syntax: command <<< "some sentence" (Like echo "some sentence" | command, but without the overhead of the subshell)


Process Substitution: <(command) or >(command) is replaced by a FIFO or /dev/fd/* entry. Basically shorthand for setting up a named pipe. See http://mywiki.wooledge.org/ProcessSubstitution Example: diff -u <(sort file1) <(sort file2)


command < <(othercommand) # Same thing as othercommand | command but without subshelling 'command'. Uses file redirection (<) to redirect a file created by process substitution (<()). The space between < and <(..) is important to avoid ambiguity (is it a heredoc, is it a redirected PS?).