Searching for Forum "cowsay" post  [Solved]

Here you can just talk about MX or post interesting topics about what you have done in MX that you want to share with others. Other non-MX topics can be discussed within the Rules of the Forum.
Message
Author
User avatar
operadude
Posts: 1075
Joined: Tue Nov 05, 2019 12:08 am

Re: Searching for Forum "cowsay" post

#21 Post by operadude »

Or, create a file "moo.sh":

Code: Select all

sudo nano moo.sh

#!/bin/bash
output=$(cowsay <<< $2)
for ((i = 0; i < $1; i += 1)); do
        output=$(cowsay -n <<< "$output");
        done
echo "$output"
Change owner and permissions:

Code: Select all

sudo chown opera-dude:opera-dude moo.sh
sudo chmod u+x moo.sh
Run the script:

Code: Select all

bash moo.sh 5 'Holy Cow!'
Result:

Code: Select all

 ______________________________________________
/  __________________________________________  \
| /  ______________________________________  \ |
| | /  __________________________________  \ | |
| | | /  ______________________________  \ | | |
| | | | /  __________                  \ | | | |
| | | | | < Holy Cow >                 | | | | |
| | | | |  ----------                  | | | | |
| | | | |         \   ^__^             | | | | |
| | | | |          \  (oo)\_______     | | | | |
| | | | |             (__)\       )\/\ | | | | |
| | | | |                 ||----w |    | | | | |
| | | | \                 ||     ||    / | | | |
| | | |  ------------------------------  | | | |
| | | |         \   ^__^                 | | | |
| | | |          \  (oo)\_______         | | | |
| | | |             (__)\       )\/\     | | | |
| | | |                 ||----w |        | | | |
| | | \                 ||     ||        / | | |
| | |  ----------------------------------  | | |
| | |         \   ^__^                     | | |
| | |          \  (oo)\_______             | | |
| | |             (__)\       )\/\         | | |
| | |                 ||----w |            | | |
| | \                 ||     ||            / | |
| |  --------------------------------------  | |
| |         \   ^__^                         | |
| |          \  (oo)\_______                 | |
| |             (__)\       )\/\             | |
| |                 ||----w |                | |
| \                 ||     ||                / |
|  ------------------------------------------  |
|         \   ^__^                             |
|          \  (oo)\_______                     |
|             (__)\       )\/\                 |
|                 ||----w |                    |
\                 ||     ||                    /
 ----------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

User avatar
operadude
Posts: 1075
Joined: Tue Nov 05, 2019 12:08 am

Re: Searching for Forum "cowsay" post

#22 Post by operadude »

Well, it's been a real education :exclamation: :exclamation: :exclamation:

Seriously 🙏🏻

Along the way, I learned about ASCII-art, a bit of the "Perl" language, bash-scripting, and even some "Ansible Playbooks" :spinning:

Who would of thunk-it :p

Not sure how this particular rabbit-hole got me to Ansible, but it was quite serendipitous, given that @DukeComposed posted today, on a different thread (opened by @CharlesV), about how he uses Ansible :celebrate:

Crazy, Man, Crazy! :happy:

Although I never found exactly what I thought I saw many moons ago; nevertheless, I am marking this thread as "[SOLVED]".

As a reminder, I have a vague memory of seeing a post in this Forum, where a member illustrated using the CLI to create an ASCII cow (or was it a "gnu"?), and then issuing some kind of command on the NEXT line of the command line, to somehow output an even bigger cow/gnu (maybe it was recursive-- cows thinking of cows? I don't remember, exactly).

Anyway, at this point, all I have to say is:

Code: Select all

 _________________________________________________
/  _____________________________________________  \
| /  _________________________________________  \ |
| | < Looks like we are beating a dead...COW? > | |
| |  -----------------------------------------  | |
| |         \   ^__^                            | |
| |          \  (xx)\_______                    | |
| |             (__)\       )\/\                | |
| |              U  ||----w |                   | |
| \                 ||     ||                   / |
|  ---------------------------------------------  |
|         \   ^__^                                |
|          \  (xx)\_______                        |
|             (__)\       )\/\                    |
|              U  ||----w |                       |
\                 ||     ||                       /
 -------------------------------------------------
       \          /\/\
        \         \/\/
         \        /   -\
          \     /  xx   -\
           \  /           \
             |    ---\    -\
             \--/     \     \
              U        |      -\
                        \       -\         -------------\    /-\
                         \        \-------/              ---/    \
                          \                                  |\   \
                           |                                 / |  |
                           \                                |  \  |
                            |                              /    \ |
                            |                             /     \ |
                             \                             \     \|
                              -              /--------\    |      o
                               \+   +---------          \   |
                                |   |                   |   \
                                |   |                    \   |
                                |   |                    |   \
                                |   |                     \   |
                                 \  |                     |   |
                                 |  |                      \  \
                                 |  |                      |   |
                                 +--+                       ---+
If anyone remembers that enigmatic "CLI-make-the-gnu-grow-thing", please drop me a line :cool:

Post Reply

Return to “Community Fun”