Emacs won't read standard input unless it's running in batch mode. Instead, you can use a command-line option to pass a Lisp form which Emacs will evaluate immediately after initialization:
emacs --eval '(shell-command "command1")'
This will execute
command1 and capture its output into a buffer named
*Shell Command Output*, which you can then rename, edit, &c. to taste.
Once done, you can pass the result to
command2 by means of
C-x h M-| command2 RET;
C-x h calls mark-whole-buffer so that the region encompasses the entirety of your edited text, and
shell-command-on-region to execute
command2 and supply contents of the region on standard input. (If you've rebound either of those chords, just call the relevant function directly via
M-x function-name RET instead; as with all interactive Emacs Lisp functions, they will use the minibuffer to prompt for the arguments they need.)
shell-command-on-region will capture standard output to the
*Shell Command Output* buffer, replacing whatever happens to be there; if you want to keep around the edited output of
command1, rename the buffer before invoking
One further note: you may find it useful to know that both
shell-command-on-region take an optional output buffer argument, as either a buffer or a buffer name; if a buffer by the name given does not exist, a new buffer by that name will be created. See the internal documentation (
C-h f function-name RET or
M-x describe-function RET function-name RET) for more.