A Shell series dedicated to practical and fun 🌝

This is the first in a series of Shell’s “Real Fun” series, in which the middle finger is… oh no, simple, practical or fun.

So here comes the hello!

preface

Recently, I found an amazing combination, Cowsay + Motivate, that can help you build a cow at the end of your life who is very good at giving you advice and saying good quotes.

  • Github.com/piuccio/cow…
  • Github.com/mubaris/mot…


The effect is as follows:

In addition to small cows, you can specify any cowsay image:



There are about 190 cowsay images. You can run the following command to view information

cowsay -l
Copy the code

If you are interested in this chicken soup for the soul and want to warm your stomach with a drink from time to time, you can click on the following steps in two minutes

Operational guidelines for school official cites use

The first step 👉

Install motivate. This is a terminal script developed by Python. There are about 4,000 to 5,000 English quotes in it.

git clone https://github.com/mubaris/motivate.git
cd motivate/motivate
sudo ./install.sh
source ~/.bashrc
Copy the code

The second step 👉

Install cowsay. This is a terminal script developed by Node.js.

npm install -g cowsay
Copy the code

The third step 👉

Copy the following script and run it on the terminal. Here’s Bash Here Docs, which writes cowmo’s Bash function plain text to ~/.bash_profile as we write below. (If you are using ~/.bashrc or other, please adjust accordingly.)

cat >> ~/.bash_profile << 'EOF'
cowmo() {
  local NUM="$((1 + RANDOM % 10))"

  case "$NUM" in
  "1")
    cowsay -rb $(motivate --no-colors)
    ;;
  "2")
    cowsay -rd $(motivate --no-colors)
    ;;
  "3")
    cowsay -rg $(motivate --no-colors)
    ;;
  "4")
    cowsay -rp $(motivate --no-colors)
    ;;
  "5")
    cowsay -rs $(motivate --no-colors)
    ;;
  "6")
    cowsay -rt $(motivate --no-colors)
    ;;
  "Seven")
    cowsay -ry $(motivate --no-colors)
    ;;
  *)
    cowsay -rp -f 'www' $(motivate --no-colors)
    ;;
  esac
}

cowmo
EOF
Copy the code

👉 step 4

Restart command line terminal ~

source ~/.bash_profile
Copy the code


You’ll see a bowl of chicken soup on the command line

summary

Turn on the terminal and you’ll be fed a warm chicken soup that might give you an energy boost for the day. Of course, if you’re really hungry, you can order a bowl of chicken soup (type cowmo).