Can't pipe to lolcat in bash script

726 views Asked by At

I'm trying to modify my motd script in Armbian on my OrangePI. Just wanted to plot name of my machine, instead of big ORANGE PI PC. I found, that I have to edit /etc/update-motd.d/10-armbian-header. There were this lines:

if [ $(echo $BOARD_NAME | wc -c) -ge 18 ]; then
    TERM=linux toilet -f standard -F metal $(echo $BOARD_NAME | sed 's/Orange Pi/OPi/' | sed 's/Nanopi/NPi/')
else
    TERM=linux toilet -f standard -F metal $BOARD_NAME
fi

So i basically just changed it to

TERM=linux toilet -f standard MachineName | lolcat

as it's displayed on all my other machines. But it's not working. If I don't pipe it to lolcat it's perfectly good, I have good, but uncollored inscription. What am I doing wrong?

1

There are 1 answers

0
Setherith On

I fixed this on my system by adding the -f or --force option:

figlet "HELLO WORLD" | /usr/games/lolcat -f

I actually found the answer on StackExchange so credit should go to Nick Matteo.