I'm not sure why I had never looked into this before, but this evening I became obsessed with discovering how to present different colored text in the /etc/motd. A person had suggested creating a shell script (rather than using special editing modes in vi, or something) and I agree that is the simplest way of getting this accomplished quickly.
I found this example on the web and I wish I could recall where so that I could provide credit to that person.
This most noteworthy portion of this script is the following:
RESET="\033[0m"
that puts the users shell back to the original color. I typically like a green text on black background.
Also - a great reference for the different colors and font-type (underscore, etc...)
I found this example on the web and I wish I could recall where so that I could provide credit to that person.
#!/bin/bash #define the filename to use as output motd="/etc/motd" # Collect useful information about your system # $USER is automatically defined HOSTNAME=`uname -n` KERNEL=`uname -r` CPU=`uname -p` ARCH=`uname -m` # The different colours as variables W="\033[01;37m" # WHITE B="\033[01;34m" # BLUE G="\033[01;32m" # GREEN R="\033[01;31m" # RED X="\033[00;37m" # Not sure... RESET="\033[0m" clear > $motd # to clear the screen when showing up echo -e "Oracle Corporation SunOS 5.10 Generic Patch January 2005 " >> $motd echo -e " ______ " >> $motd echo -e " /_____/\ " >> $motd echo -e " /_____\\ \ " >> $motd echo -e " /_____\ \\ / " >> $motd echo -e " /_____/ \/ / / " >> $motd echo -e " /_____/ / \//\ " >> $motd echo -e " \_____\//\ / / " >> $motd echo -e " \_____/ / /\ / " >> $motd echo -e " \_____/ \\ \ " >> $motd echo -e " \_____\ \\ " >> $motd echo -e " \_____\/ Oracle is not Sun " >> $motd echo -e " " >> $motd echo -e "#=============================================================================#" >> $motd echo -e " $W Welcome $B $USER $W to $B $HOSTNAME " >> $motd echo -e " $R ARCH $W= $ARCH " >> $motd echo -e " $R KERNEL $W= $KERNEL " >> $motd echo -e " $R CPU $W= $CPU $RESET " >> $motd echo -e "#=============================================================================#" >> $motd
Motd With Colors! (Also Applies To Shell Profiles) >>>>> Download Now
ReplyDelete>>>>> Download Full
Motd With Colors! (Also Applies To Shell Profiles) >>>>> Download LINK
>>>>> Download Now
Motd With Colors! (Also Applies To Shell Profiles) >>>>> Download Full
>>>>> Download LINK R3