But why it's got to get so complicated ... :)
Anyway, note:
echo -e "Hello \nWorld \n" >> greetings.txt
Or, alternatively just output each line with a separate echo statement and printing to append with the >> piper.
SO: shell - how to pipe commands in ubuntu