/srv/irclogs.ubuntu.com/2020/05/11/#ubuntu-quality.txt

ubuntutestingbot[telegram] <philipz> @franksmcb found this mentioned on twitter and wanted to bring to your attention in case you didn't already hear about it. :03:31
ubuntutestingbot[telegram] <philipz> https://twitter.com/_victorgnu/status/125964067673364889803:31
ubuntutestingbot[telegram] <GalacticLion7> Does anyone know how to write a text file with multiple lines in a shell script without using \n?03:45
ubuntutestingbot[telegram] <philipz> 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?)04:20
ubuntutestingbot[telegram] <philipz> or more accurately not sure where to find it, but do know how its done, as it works the same way in php04:23
=== slyon_ is now known as slyon
ubuntutestingbot[telegram] <MrkiMike> mario@MP50 /tmp/t> cat << EOF > file.txt08:57
ubuntutestingbot[telegram] <MrkiMike> > 108:57
ubuntutestingbot[telegram] <MrkiMike> > 208:57
ubuntutestingbot[telegram] <MrkiMike> > 308:57
ubuntutestingbot[telegram] <MrkiMike> > EOF08:58
ubuntutestingbot[telegram] <MrkiMike> mario@MP50 /tmp/t> cat file.txt08:58
ubuntutestingbot[telegram] <MrkiMike> 108:58
ubuntutestingbot[telegram] <MrkiMike> 208:58
ubuntutestingbot[telegram] <MrkiMike> 308:58
ubuntutestingbot[telegram] <MrkiMike> mario@MP50 /tmp/t>08:58
ubuntutestingbot[telegram] <MrkiMike> These > before each number are because I did it directly in shell, so I had to type EOF to 'finish'08:58
ubuntutestingbot[telegram] <GalacticLion7> 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')10:31
ubuntutestingbot[telegram] <MrkiMike> nop10:37
ubuntutestingbot[telegram] <MrkiMike> here is an example: https://stackoverflow.com/questions/2500436/how-does-cat-eof-work-in-bash10:37
ubuntutestingbot[telegram] <MrkiMike> or: https://www.cyberciti.biz/faq/using-heredoc-rediection-in-bash-shell-script-to-write-to-file/10:37
ubuntutestingbot[telegram] <MrkiMike> But... better question from my side would be - what are you trying to do/achieve? Maybe there is a better way.10:38
ubuntutestingbot[telegram] <GalacticLion7> 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.)10:45
ubuntutestingbot[telegram] <MrkiMike> Are those parametrized somehow?10:46
ubuntutestingbot[telegram] <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?10:47
ubuntutestingbot[telegram] <GalacticLion7> They are (re @MrkiMike: Are those parametrized somehow?)10:48
ubuntutestingbot[telegram] <GalacticLion7> 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?)10:48
ubuntutestingbot[telegram] <Zachariah> Oh and you need a way to output multi-line.10:49
ubuntutestingbot[telegram] <GalacticLion7> 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?)10:49
ubuntutestingbot[telegram] <GalacticLion7> Does export work in scripts?10:50
ubuntutestingbot[telegram] <MrkiMike> it does, but... it might not do what you expect10:50
ubuntutestingbot[telegram] <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 things10:51
ubuntutestingbot[telegram] <Zachariah> You can use:10:52
ubuntutestingbot[telegram] <Zachariah> cat > file.conf << EOL10:52
ubuntutestingbot[telegram] <Zachariah> line 1, abc10:52
ubuntutestingbot[telegram] <Zachariah> line 2, def10:52
ubuntutestingbot[telegram] <Zachariah> line 3, ghi10:52
ubuntutestingbot[telegram] <Zachariah> EOL10:52
ubuntutestingbot[telegram] <Zachariah> Which is just the heredoc approach.10:52
ubuntutestingbot[telegram] <GalacticLion7> 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)10:55
ubuntutestingbot[telegram] <GalacticLion7> I need to do something like10:58
ubuntutestingbot[telegram] <GalacticLion7> bash10:58
ubuntutestingbot[telegram] <GalacticLion7> export Key="Your Key"10:58
ubuntutestingbot[telegram] <GalacticLion7> export Email="Your Email" (re @MrkiMike: it does, but... it might not do what you expect)10:58
ubuntutestingbot[telegram] <GalacticLion7> I need to do something like10:58
ubuntutestingbot[telegram] <GalacticLion7> export Key="Your Key"10:58
ubuntutestingbot[telegram] <GalacticLion7> export Email="Your Email" (edited) (re @MrkiMike: it does, but... it might not do what you expect)10:58
ubuntutestingbot[telegram] <GalacticLion7> The solution above was using EOF, what is the difference? (re @Zachariah: You can use:10:58
ubuntutestingbot[telegram] <GalacticLion7> cat > file.conf << EOL10:58
ubuntutestingbot[telegram] <GalacticLion7> line 1, abc10:58
ubuntutestingbot[telegram] <GalacticLion7> line 2, def10:58
ubuntutestingbot[telegram] <GalacticLion7> line 3, ghi10:58
ubuntutestingbot[telegram] <GalacticLion7> EOL)10:58
ubuntutestingbot[telegram] <GalacticLion7> I would also like to append to crontab10:59
ubuntutestingbot[telegram] <Ron> Greetings. I have Nividia GTX 1050ti. No audio from HDMI port. Can anybody help?11:15
ubuntutestingbot[telegram] <Zachariah> 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:11:28
ubuntutestingbot[telegram] <Zachariah> conf1 = "abc"11:28
ubuntutestingbot[telegram] <Zachariah> conf2 = "def"11:28
ubuntutestingbot[telegram] <Zachariah> conf3 = "ghi"11:28
ubuntutestingbot[telegram] <Zachariah> cat > file.conf <<EOL11:28
ubuntutestingbot[telegram] <Zachariah> line 1, ${conf1}11:28
ubuntutestingbot[telegram] <Zachariah> line 2, ${conf2}11:28
ubuntutestingbot[telegram] <Zachariah> line 3, ${conf3}11:28
ubuntutestingbot[telegram] <Zachariah> line 4 this is the end of the config11:28
ubuntutestingbot[telegram] <Zachariah> EOL (re @GalacticLion7: The solution above was using EOF, what is the difference?)11:28
ubuntutestingbot[telegram] <Zachariah> 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?)11:29
ubuntutestingbot[telegram] <Ron> using the Nvidia 440 driver.  how to config the sound settings?11:39
ubuntutestingbot[telegram] <Zachariah> System Settings -> Sound11:39
ubuntutestingbot[telegram] <Zachariah> Sometimes you get multiple HDMI audio outputs. You just need to select each one and test to figure out which one is correct.11:41
ubuntutestingbot[telegram] <Ron> I did use the settings menus to choose the Nvidia card for audio. But no sound.11:41
ubuntutestingbot[telegram] <Zachariah> Was there only one or multiple like HDMI 0, HDMI 1, etc.?11:42
ubuntutestingbot[telegram] <Ron> only 1.  the choice is the internal audio or the Nividia card, simple!11:43
ubuntutestingbot[telegram] <Zachariah> Have you tested HDMI audio with another source? Just to be sure?11:44
ubuntutestingbot[telegram] <Ron> 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.11:49
ubuntutestingbot[telegram] <Ron> [please excuse typos].11:50
ubuntutestingbot[telegram] <Zachariah> 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.11:53
ubuntutestingbot[telegram] <Ron> 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.11:56
=== jphilips_ is now known as jphilips

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!