Pipe multiple commands into a single command

Use parentheses ()'s to combine the commands into a single process, which will concatenate the stdout of each of them.

Example 1 (note that $ is the shell prompt):

$ (echo zzz; echo aaa; echo kkk) | sort
aaa
kkk
zzz


Example 2:

(setopt; unsetopt; set) | sort

You can use {} for this and eliminate the need for a sub-shell as in (list), like so:

{ echo zzz; echo aaa; echo kkk; } | sort

We do need a whitespace character after { and before }. We also need the last ; when the sequence is written on a single line.

We could also write it on multiple lines without the need for any ;:

Example 1:

{
  echo zzz
  echo aaa
  echo kkk
} | sort

Example 2:

{
  setopt
  unsetopt
  set
} | sort