<div dir="ltr">Sorry, rough afternoon yesterday...<div><br></div><div>cat reads then writes to stdout</div><div><br></div><div>If you're using echo, in the sense we're discussing, it will never even see the stdin you're attempting to send. To test run the following and you'll see the test file contains the echo'd 1 </div><div><br></div><div>$ echo "1" > test << EOF</div><div>> 2</div><div>> EOF</div><div>$ cat test</div><div>1</div><div><br></div><div>Another way to see this would be:</div><div><br>$ > test << EOF | echo 1<br>> EOF<br>1<br>$ cat test<br>[nothing returned]</div><div><br></div><div>Another:</div><div><br></div><div><div>$ echo > test << EOF</div><div>> 1</div><div>> 2</div><div>> EOF</div><div>$ cat test </div><div>[nothing returned]<br></div><div><br></div></div><div>You can do this:</div><div><br></div><div>$ echo 1 > test</div><div>$ cat test</div><div>1</div><div><br></div><div>It takes a while to grasp, believe me. Sometimes I'll type something out and go, "huh, why didn't that work". Then I look at it, "doh!".</div><div><br></div><div>read read read</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 10, 2015 at 1:45 PM, Michael Havens <span dir="ltr"><<a href="mailto:bmike1@gmail.com" target="_blank">bmike1@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">why would it not work with echo?</div><div class="gmail_extra"><br clear="all"><div><div>:-)~MIKE~(-:</div></div>
<br><div class="gmail_quote">On Tue, Mar 10, 2015 at 7:53 AM, Mike Ballon <span dir="ltr"><<a href="mailto:mike.ballon@gmail.com" target="_blank">mike.ballon@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">First, if you're just trying to backup conf files, then simply make a backup of the conf file and restore it when needed.<div><br></div><div>To answer your question, yes, specifically with the cat command, this won't work with echo. You can test this on your own and t</div><div><br></div><div><div>$ cat > test << EOF</div><div>> 1</div><div>> 2</div><div>> 3</div><div>> EOF</div><div>$ cat test </div><div>1</div><div>2</div><div>3</div><div>$ cat >> test << EOF</div><div>> 4</div><div>> EOF</div><div>$ cat test </div><div>1</div><div>2</div><div>3</div><div>4</div></div><div><br></div><div>You can also start with an append if you wish:</div><div><br></div><div><div>$ cat >> test << EOF</div><div>> 1</div><div>> 2</div><div>> EOF</div><div>$ cat test </div><div>1</div><div>2</div></div><div><br></div><div><a href="http://www.linuxjournal.com/content/working-stdin-and-stdout" target="_blank">http://www.linuxjournal.com/content/working-stdin-and-stdout</a><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Mon, Mar 9, 2015 at 11:51 PM, Michael Havens <span dir="ltr"><<a href="mailto:bmike1@gmail.com" target="_blank">bmike1@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">do you think this would have the desired effect?<div><br></div><div><div><br></div><div>sudo cat >> /etc/apt/apt.conf << eof</div><div>Acquire::Queue-Mode "host";</div><div>eof</div><div><br></div><div>sudo cat >> /etc/sysctl.conf << eof</div><div># </div><div># Reduce the swap tendency </div><div>vm.swappiness = 10</div><div>eof</div><div><br></div><div>sudo cat >> /etc/apache2/apache2.conf << eof</div><div>Include /etc/phpmyadmin/apache.conf</div><div>eof</div><div><br></div><div>sudo cat >> /etc/fstab << eof</div><div>/media/bmike1/entertainment/Pictures /home/bmike1/Pictures none bind 0 0 </div><div>eof</div></div><div><br></div><div>would the single line appendages just need the blank line?</div></div><div class="gmail_extra"><br clear="all"><div><div>:-)~MIKE~(-:</div></div><div><div>
<br><div class="gmail_quote">On Mon, Mar 9, 2015 at 8:41 PM, Michael Havens <span dir="ltr"><<a href="mailto:bmike1@gmail.com" target="_blank">bmike1@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Okay now, I learned just today how >> works and I want to update all of my reinstall scripts so all I need to do is copy-n-paste into a terminal and everything will be done. Learned when I was doing Linux from scratch that to create a file of multiple lines without starting an editor you do:<div><br><div><pre style="border:1px solid rgb(5,5,5);padding:0.5em 1em;margin:0px 2em 0.5em;color:rgb(16,19,16);line-height:19.2000007629395px;background-color:rgb(229,229,229)"><kbd><b>cat > filename << "EOF"
</b>contents </kbd></pre><pre style="border:1px solid rgb(5,5,5);padding:0.5em 1em;margin:0px 2em 0.5em;color:rgb(16,19,16);line-height:19.2000007629395px;background-color:rgb(229,229,229)"><kbd><b>of</b></kbd></pre><pre style="border:1px solid rgb(5,5,5);padding:0.5em 1em;margin:0px 2em 0.5em;color:rgb(16,19,16);line-height:19.2000007629395px;background-color:rgb(229,229,229)"><kbd><b>file</b></kbd></pre><pre style="border:1px solid rgb(5,5,5);padding:0.5em 1em;margin:0px 2em 0.5em;color:rgb(16,19,16);line-height:19.2000007629395px;background-color:rgb(229,229,229)"><b style="line-height:19.2000007629395px;font-family:arial,sans-serif">EOF</b></pre><div><div><div> Oh.... I think I get it. just turn the '>' into '>>'</div><div>am I correct? </div><div><br></div><div>:-)~MIKE~(-:</div></div>
</div></div></div></div>
</blockquote></div><br></div></div></div>
<br></div></div><span>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></span></blockquote></div><br></div>
<br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div><br></div>
<br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div><br></div>