 @franksmcb found this mentioned on twitter and wanted to bring to your attention in case you didn't already hear about it. :
 https://twitter.com/_victorgnu/status/1259640676733648898
 Does anyone know how to write a text file with multiple lines in a shell script without using \n?
 i've seen it done with these << arrows before, but not sure exactly how its done (re @GalacticLion7: Does anyone know how to write a text file with multiple lines in a shell script without using \n?)
 or more accurately not sure where to find it, but do know how its done, as it works the same way in php
 mario@MP50 /tmp/t> cat << EOF > file.txt
 > 1
 > 2
 > 3
 > EOF
 mario@MP50 /tmp/t> cat file.txt
 1
 2
 3
 mario@MP50 /tmp/t>
 These > before each number are because I did it directly in shell, so I had to type EOF to 'finish'
 does it exit a shell script if I use EOF? (re @MrkiMike: These > before each number are because I did it directly in shell, so I had to type EOF to 'finish')
 nop
 here is an example: https://stackoverflow.com/questions/2500436/how-does-cat-eof-work-in-bash
 or: https://www.cyberciti.biz/faq/using-heredoc-rediection-in-bash-shell-script-to-write-to-file/
 But... better question from my side would be - what are you trying to do/achieve? Maybe there is a better way.
 I was trying to make a shell script that sets up my Nginx reverse proxy configs (re @MrkiMike: But... better question from my side would be - what are you trying to do/achieve? Maybe there is a better way.)
 Are those parametrized somehow?
 nginx has its own configuration files. You set up reverse proxy in the config. Were you looking for a way to edit the config with sed from a bash script?
 They are (re @MrkiMike: Are those parametrized somehow?)
 Not edit, just create new sites in /etc/nginx/sites-available (re @Zachariah: nginx has its own configuration files. You set up reverse proxy in the config. Were you looking for a way to edit the config with sed from a bash script?)
 Oh and you need a way to output multi-line.
 Not edit, just create new files in /etc/nginx/sites-available (edited) (re @Zachariah: nginx has its own configuration files. You set up reverse proxy in the config. Were you looking for a way to edit the config with sed from a bash script?)
 Does export work in scripts?
 it does, but... it might not do what you expect
 @GalacticLion7 maybe taking a look at ansible would be better - it's a tool designed to parametrize setups/deployments, and it's ideal for small to medium sized things
 You can use:
 cat > file.conf << EOL
 line 1, abc
 line 2, def
 line 3, ghi
 EOL
 Which is just the heredoc approach.
 Learning curve? (re @MrkiMike: @GalacticLion7 maybe taking a look at ansible would be better - it's a tool designed to parametrize setups/deployments, and it's ideal for small to medium sized things)
 I need to do something like
 bash
 export Key="Your Key"
 export Email="Your Email" (re @MrkiMike: it does, but... it might not do what you expect)
 I need to do something like
 export Key="Your Key"
 export Email="Your Email" (edited) (re @MrkiMike: it does, but... it might not do what you expect)
 The solution above was using EOF, what is the difference? (re @Zachariah: You can use:
 cat > file.conf << EOL
 line 1, abc
 line 2, def
 line 3, ghi
 EOL)
 I would also like to append to crontab
 Greetings. I have Nividia GTX 1050ti. No audio from HDMI port. Can anybody help?
 The EOF approach is generally used when entering data manually. The EOL method gives you more granular control of your lines. For instance, you could do something like:
 conf1 = "abc"
 conf2 = "def"
 conf3 = "ghi"
 cat > file.conf <<EOL
 line 1, ${conf1}
 line 2, ${conf2}
 line 3, ${conf3}
 line 4 this is the end of the config
 EOL (re @GalacticLion7: The solution above was using EOF, what is the difference?)
 Are you using Nouveau or the nVidia proprietary driver? If the latter, you may need to play around with your sound settings until you find the correct output. (re @Ron: Greetings. I have Nividia GTX 1050ti. No audio from HDMI port. Can anybody help?)
 using the Nvidia 440 driver.  how to config the sound settings?
 System Settings -> Sound
 Sometimes you get multiple HDMI audio outputs. You just need to select each one and test to figure out which one is correct.
 I did use the settings menus to choose the Nvidia card for audio. But no sound.
 Was there only one or multiple like HDMI 0, HDMI 1, etc.?
 only 1.  the choice is the internal audio or the Nividia card, simple!
 Have you tested HDMI audio with another source? Just to be sure?
 well, the source is the HDMI port in the Nvidia card in my desktop.  I have a HDMI2VGA converter with vga and analog audio jack, and my stereo is plugged into this converter via the 3.5 audio jack. no sound. I have not yet tried to go from Nvidia HDMI directly into another coimpatiblbe device, as I have none.  The Nvidia and converter are brand new.
 [please excuse typos].
 I see. So HDMI is 2-way communication. The video card needs to receive information from the device it is attached to. A TV or monitor should allow the video card to know it is a sound source. But a custom device like your converter may not communicate correctly.
 oh, this I had not realised. Could be the device, indeed.  Thanks for this info and your kind replies.  I will investigate this further.  Bye for now.