bash

ubuntu: write multiple lines to a text file  #angularjs #reactjs

  • cat <> /etc/apache2/sites-available/eco.conf ServerName eco.vagrant DocumentRoot /var/www/eco/website/public Options FollowSymLinks AllowOverride All # Logging ErrorLog /var/log/apache2/eco-error.log LogLevel notice CustomLog /var/log/apache2/eco-access.log combined EOT
  • The question would be better suited to Super User or the Linux SE site.
  • If the question can be reworded to fit the rules in the help center , please edit the question .
  • Stack Overflow works best with JavaScript enabled
  • You may be able to get help on Super User .”

I quite like having it like this, rather than a single line, as it’s within a bash script and I can clearly see the content of what will be written with indentation etc.

@ng_real_ninja: ubuntu: write multiple lines to a text file #angularjs #reactjs

I’m trying to write multiple lines to a text file like so:

but just the same.

I quite like having it like this, rather than a single line, as it’s within a bash script and I can clearly see the content of what will be written with indentation etc.

What tool ought I use to write in this manner? Or how should I be using cat here?

“Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming. You may be able to get help on Super User.” – bmargulies, EJoshuaS, Mark Rotteveel, Jonathan Argentiero, EdChum

, the output redirection is happening in your original shell, not in the superuser process, so it still fails. You need to move the redirection into the superuser process, by executing a shell explicitly.

like:

My advisor said that I should be more modest, and we should meet more often. Should I tell him about my imposter syndrome? If yes, mail or personal?

bash