Cat with heredoc does not work in zsh shell Cat with heredoc does not work in zsh shell shell shell

Cat with heredoc does not work in zsh shell


Here is another way to write it:

cat <<eos > filenamefoo bar bazeos

That works in zsh.


This could happen if your /tmp (or wherever your $TMPDIR points) were read-only.

You should be able to discover what's wrong by attaching strace to the zsh you're running the above from, using e.g. strace -ff -s200 -o /tmp/zsh.log -p PID-goes-here from a different shell.