<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Morgan Murrah</title>
    <description>The latest articles on DEV Community by Morgan Murrah (@airbr).</description>
    <link>https://dev.to/airbr</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F18045%2F2a8c7b45-fe74-4e51-9b5d-6bc54ee0ed26.png</url>
      <title>DEV Community: Morgan Murrah</title>
      <link>https://dev.to/airbr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/airbr"/>
    <language>en</language>
    <item>
      <title>Fun unix basics with fortune and cowsay</title>
      <dc:creator>Morgan Murrah</dc:creator>
      <pubDate>Fri, 27 Sep 2019 02:36:01 +0000</pubDate>
      <link>https://dev.to/airbr/fun-unix-basics-with-fortune-and-cowsay-2okf</link>
      <guid>https://dev.to/airbr/fun-unix-basics-with-fortune-and-cowsay-2okf</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cowsay "lets have fun on the command line"
 ___________________________________ 
&amp;lt; lets have fun on the command line &amp;gt;
 ----------------------------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The following exercise is intended to provide some simple enjoyment and cover some some unix command line concepts. This tutorial assumes you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;are able to use a terminal i.e opening the terminal application on Mac OS and have some basic unix knowledge&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;have homebrew installed or are otherwise able to install the two programs fortune and cowsay if they are not on your system&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;brew install cowsay&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;brew install fortune&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are alternate ways to install these programs on a variety of systems and in different languages.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open a terminal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Say Hello the old way &lt;code&gt;echo hello&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ echo hello
hello
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now try saying it with cowsay &lt;code&gt;cowsay hello&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cowsay hello
 _______ 
&amp;lt; hello &amp;gt;
 ------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;:).&lt;/p&gt;

&lt;p&gt;Get a pseudo random fortune epigram from the program &lt;code&gt;fortune&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ fortune
"The History of every major Galactic Civilization tends to pass through
three distinct and recognizable phases, those of Survival, Inquiry and
Sophistication, otherwise known as the How, Why and Where phases.
"For instance, the first phase is characterized by the question 'How can
we eat?' the second by the question 'Why do we eat?' and the third by
the question 'Where shall we have lunch?'"
-- Hitchhiker's Guide to the Galaxy

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Get your Cow to say a fortune! (by using the pipe | operator)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ fortune | cowsay
 ___________________________________ 
/  "You boys lookin' for trouble?"  \
|                                   |
| "Sure. Whaddya got?"              |
|                                   |
\ -- Marlon Brando, "The Wild Ones" /
 ----------------------------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We are really moo'ving right along!&lt;/p&gt;

&lt;p&gt;In this simple progression we have seen how two simple programs can interact with each other, the standard output of fortune can be redirected into cowsay which creates the ASCII cow with the enclosed text!&lt;/p&gt;

&lt;p&gt;Lets take this piping arrangement to the next level with the program &lt;a href="https://en.wikipedia.org/wiki/Tee_(command)"&gt;tee&lt;/a&gt; that takes stdin and then by default overwrites a file or can append to a file, while also passing that stdin to stdout to the console.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ fortune | cowsay | tee save-cow-to-file.txt 

 ________________________________________ 
/ When you dial a wrong number you never \
\ get a busy signal.                     /
 ---------------------------------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||


$ cat save-cow-to-file.txt 
 ________________________________________ 
/ When you dial a wrong number you never \
\ get a busy signal.                     /
 ---------------------------------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we have a copy of the cow's fortune saved to a file. Lets append to that file with the -a flag on tee:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ fortune | cowsay | tee -a  save-cow-to-file.txt 
 ______________________________________ 
/ Competence, like truth, beauty, and  \
| contact lenses, is in the eye of the |
| beholder.                            |
|                                      |
\ -- Dr. Laurence J. Peter             /
 -------------------------------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||


$ cat save-cow-to-file.txt 
 ________________________________________ 
/ When you dial a wrong number you never \
\ get a busy signal.                     /
 ---------------------------------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
 ______________________________________ 
/ Competence, like truth, beauty, and  \
| contact lenses, is in the eye of the |
| beholder.                            |
|                                      |
\ -- Dr. Laurence J. Peter             /
 -------------------------------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You now have a pipeline going able to create a collection of generated cows with interesting epigrams written to a file! &lt;/p&gt;

&lt;p&gt;There is plenty of room for creative expression- check out all the flags on cowsay by checking its man page &lt;code&gt;man cowsay&lt;/code&gt;. &lt;/p&gt;

</description>
      <category>unix</category>
      <category>pipe</category>
      <category>cowsay</category>
      <category>fortune</category>
    </item>
    <item>
      <title>A brief note of love for Markdown        </title>
      <dc:creator>Morgan Murrah</dc:creator>
      <pubDate>Sun, 07 Apr 2019 23:57:24 +0000</pubDate>
      <link>https://dev.to/airbr/a-brief-note-of-love-for-markdown-4hj5</link>
      <guid>https://dev.to/airbr/a-brief-note-of-love-for-markdown-4hj5</guid>
      <description>

&lt;p&gt;I have fond memories of using Markdown early on when I was learning to code which really started just over two years ago. When I was finding JavaScript challenging in one of my early projects I remember taking one afternoon to work through cheat sheets of Markdown syntax and make some nicely formatted ReadMe files.&lt;/p&gt;

&lt;p&gt;A nicely formatted Markdown file as a ReadMe on Github with &lt;code&gt;code formatted&lt;/code&gt; instructions to enter into the terminal can really make a difference in a developer's experience. There are many libraries and projects I possibly never read further about or experimented with because it did not have a clear ReadMe.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I still use Markdown today and its an incredibly portable format for blogs and lots of things.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://macdown.uranusjr.com/"&gt;MacDown is my simple markdown editor of choice on a mac with a live preview&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's a sentence with a footnote. &lt;sup id="fnref1"&gt;1&lt;/sup&gt;&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;This is the footnote. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>coding</category>
      <category>morganmurrah</category>
      <category>markdown</category>
    </item>
  </channel>
</rss>
