In zsh
, the shell where < file1 > file2
works, the shell does invoke cat
.
For a command line that consists only of redirections and no command nor assignments, zsh
invokes $NULLCMD
(cat
by default) unless the only redirection is a <
one in which case $READNULLCMD
(pager
by default) is invoked instead. (that's unless zsh
is in sh
or csh
emulation in which case it behaves like the shells it emulates).
So:
< file1 > file2
is actually the same as
cat < file1 > file2
and
< file1
is the same as
pager < file1