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?