2

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?

1 Answers1

1

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.