Custom motd in /etc/update-motd.d/20-fortune-cowsay only working partially

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
2
down vote

favorite












I have tried to create a custom motd on Ubuntu 16.04 LTS. I've found that there is a /etc/update-motd.d directory with a few files. I've seen the pattern of [00-99]-[name]So I've added my own file called 20-fortune-cowsay. It looks like this



#!/bin/bash
echo "TEST"
fortune | cowsay


but the motd only looks like this



...
TEST
...


And I don't see the output of fortune | cowsay. Also, echo "$(fortune | cowsay)", didn't help. What am I missing?







share|improve this question
























    up vote
    2
    down vote

    favorite












    I have tried to create a custom motd on Ubuntu 16.04 LTS. I've found that there is a /etc/update-motd.d directory with a few files. I've seen the pattern of [00-99]-[name]So I've added my own file called 20-fortune-cowsay. It looks like this



    #!/bin/bash
    echo "TEST"
    fortune | cowsay


    but the motd only looks like this



    ...
    TEST
    ...


    And I don't see the output of fortune | cowsay. Also, echo "$(fortune | cowsay)", didn't help. What am I missing?







    share|improve this question






















      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I have tried to create a custom motd on Ubuntu 16.04 LTS. I've found that there is a /etc/update-motd.d directory with a few files. I've seen the pattern of [00-99]-[name]So I've added my own file called 20-fortune-cowsay. It looks like this



      #!/bin/bash
      echo "TEST"
      fortune | cowsay


      but the motd only looks like this



      ...
      TEST
      ...


      And I don't see the output of fortune | cowsay. Also, echo "$(fortune | cowsay)", didn't help. What am I missing?







      share|improve this question












      I have tried to create a custom motd on Ubuntu 16.04 LTS. I've found that there is a /etc/update-motd.d directory with a few files. I've seen the pattern of [00-99]-[name]So I've added my own file called 20-fortune-cowsay. It looks like this



      #!/bin/bash
      echo "TEST"
      fortune | cowsay


      but the motd only looks like this



      ...
      TEST
      ...


      And I don't see the output of fortune | cowsay. Also, echo "$(fortune | cowsay)", didn't help. What am I missing?









      share|improve this question











      share|improve this question




      share|improve this question










      asked May 4 at 9:05









      Impulse The Fox

      1134




      1134




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          Change your script to look like this:



          #!/bin/bash
          export PATH="/usr/games:$PATH"
          fortune | cowsay


          "fortune" and "cowsay" are considered games by ubuntu and those are not in the default system path.






          share|improve this answer






















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );








             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1031895%2fcustom-motd-in-etc-update-motd-d-20-fortune-cowsay-only-working-partially%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted










            Change your script to look like this:



            #!/bin/bash
            export PATH="/usr/games:$PATH"
            fortune | cowsay


            "fortune" and "cowsay" are considered games by ubuntu and those are not in the default system path.






            share|improve this answer


























              up vote
              1
              down vote



              accepted










              Change your script to look like this:



              #!/bin/bash
              export PATH="/usr/games:$PATH"
              fortune | cowsay


              "fortune" and "cowsay" are considered games by ubuntu and those are not in the default system path.






              share|improve this answer
























                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                Change your script to look like this:



                #!/bin/bash
                export PATH="/usr/games:$PATH"
                fortune | cowsay


                "fortune" and "cowsay" are considered games by ubuntu and those are not in the default system path.






                share|improve this answer














                Change your script to look like this:



                #!/bin/bash
                export PATH="/usr/games:$PATH"
                fortune | cowsay


                "fortune" and "cowsay" are considered games by ubuntu and those are not in the default system path.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited May 4 at 11:55

























                answered May 4 at 11:13









                Sebastian Stark

                4,663938




                4,663938






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1031895%2fcustom-motd-in-etc-update-motd-d-20-fortune-cowsay-only-working-partially%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    pylint3 and pip3 broken

                    Missing snmpget and snmpwalk

                    How to enroll fingerprints to Ubuntu 17.10 with VFS491