1

I happened to stumble on this forum thread (and every other page I find on RPi MOTD links here), and found a nice description on how to change the MOTD. However, after creating a /home/pi/.bash_profile file and using even the simplest code such as:

#!/bin/bash
echo "$(tput setaf 2)
   .~~.   .~~.
  '. \ ' ' / .'$(tput setaf 1)
   .~ .~~~..~.
  : .~.'~'.~. :
 ~ (   ) (   ) ~
( : '~'.~.'~' : )
 ~ .~ (   ) ~. ~
  (  : '~' :  ) $(tput sgr0)Raspberry Pi$(tput setaf 1)
   '~ .~~~. ~'
       '~'
$(tput sgr0)"

from here, my prompt becomes always white, instead of remaining colored.

What should/can be added to print a nice color ASCII picture and still have colored prompts/text?

EDIT: It turns out that so much as having a .bash_profile file will cause this. Is there no way around it?

Also: Sorry about the tags. Not sure what to use, but not enough rep to create new ones

1

As in man bash

   When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists.  After reading  that  file,  it
   looks  for  ~/.bash_profile,  ~/.bash_login,  and  ~/.profile,  in  that order, and reads and executes commands from the first one that exists and is readable.

By default on raspberry ~/.profile is executed which in turn executes ~/.bashrc (giving you fancy colors) and adding local bin directories to PATH (which comes in handy).

again reminder from ~/.profile

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.

And so we arrive to solution to your problem: add this line to the beginning of the ~/.bash_profile file

. "$HOME/.profile"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.