I recently bought a Raspberry Pi, and have started playing around with it. After changing my MOTD, (to include colours), the colour codes are coming up as raw-text instead of executing.I am connected to my Raspberry Pi via SSH in a Mac Terminal. I also tried directly via the Raspberries command line. How do I allow colour?This may be a very simple or mediocre question, but I am new to the Unix/Linux community and are still learning.Below is a screenshot of the failed MOTD:The file I am editing is /etc/motd. I am editing it with nano.Code below:The programs included with the Debian GNU/Linux system are free software;the exact distribution terms for each program are described in theindividual files in /usr/share/doc/*/copyright.Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extentpermitted by applicable law.#!/bin/bashecho $(tput setaf 2)   .~~.   .~~.  '. \ ' ' / .'$(tput setaf 1)   .~ .~~~..~.  : .~.'~'.~. : ~ (   ) (   ) ~( : '~'.~.'~' : ) ~ .~ (   ) ~. ~  (  : '~' :  ) $(tput sgr0)Raspberry Pi$(tput setaf 1)   '~ .~~~. ~'       '~'$(tput sgr0)
No colour in MOTD
ssh;terminal;raspberry pi;colors;motd
Due to the fact that etc/motd is a plain text file, commands are not executed, but instead printed as so:#!/bin/bashecho $(tput setaf 2)   .~~.   .~~.  '. \ ' ' / .'$(tput setaf 1)   .~ .~~~..~.  : .~.'~'.~. : ~ (   ) (   ) ~( : '~'.~.'~' : ) ~ .~ (   ) ~. ~  (  : '~' :  ) $(tput sgr0)Raspberry Pi$(tput setaf 1)   '~ .~~~. ~'       '~'$(tput sgr0)Instead, create a new file called motd.sh inside /etc and input the MOTD there instead. This is now an executable script, but is not executed. So goto /etc/profile and add at the end of the file:bash /etc/motd.shThis will now execute the script upon connection and display colour.   .~~.   .~~.  '. \ ' ' / .'   .~ .~~~..~.  : .~.'~'.~. : ~ (   ) (   ) ~( : '~'.~.'~' : ) ~ .~ (   ) ~. ~  (  : '~' :  ) Raspberry Pi   '~ .~~~. ~'       '~'