Friday, 24 June 2022

You actually CAN print multiple lines into a file using (a single, meaningful line of) bash

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