Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cat with heredoc does not work in zsh shell

When I try

cat > myfile << EOF
TEST TEXT
EOF

I just get an empty file. The same using echo command. What's going on? I can only think about something conflicting in the .zshenv profile file, but I have no idea about what it could be...

I am using zsh 4.3.6 (x86_64-suse-linux-gnu).

Update It now works with zsh 5.0.5 (x86_64-suse-linux-gnu)

like image 658
Alex Gidan Avatar asked Jul 03 '14 09:07

Alex Gidan


1 Answers

Here is another way to write it:

cat <<eos > filename
foo bar baz
eos

That works in zsh.

like image 85
Rob Jens Avatar answered Oct 18 '22 22:10

Rob Jens