This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: Display a starting message
- From: "Buchbinder, Barry (NIH/NIAID) [E]" <BBuchbinder at niaid dot nih dot gov>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Mon, 28 May 2012 17:21:37 -0400
- Subject: RE: Display a starting message
- References: <33921015.post@talk.nabble.com> <4FC3CB7E.50900@cs.umass.edu>
Eliot Moss sent the following at Monday, May 28, 2012 3:01 PM
>On 5/28/2012 2:26 PM, Shravan1804 wrote:
>> I would like my cygwin terminal to display a starting message every time I
>> start the program. For example something like "Hello Shravan, what do you
>> want to do today?" or this type of pictures :
>
>Put something in your .bash_profile (or something like that). Not a
>function of cygwin, specifically ...
Here is what I use in ~/.bashrc
sed -e 's/ The .* to /\x1B[33;44;5m&\x1B[0;37;44m/' \
-e 's/|\(.*\)|$/\x1B[1m|\x1B[44m\1\x1B[1;40m|\x1B[0m/' \
-e 's/ __* $/\x1B[1m&\x1B[0m/' \
-e 's/jgs/\x1B[1;34;44mjgs\x1B[1;37;44m/' \
~/hippo.txt
<BEGIN hippo.txt>
____________________, ______________________________________
.QQQQQQQQQQQQQQQQQQQQQQQQL_ | |
.gQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ__ | |
gQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ== | _.---.) |
QQQQQQQQQQQQQQQQQQQQQQQQQQQF= | (^--^)_.-" `; |
QQQQQQQQQ================! | ) ee ( | |
QQQQQQQQ | (_.__._) / |
QQQQQQQQ | `--', ,' |
QQQQQQQQ ~"jjj__, | jgs )_|--')_| |
QQQQQQQQ "jjjjjjjjjj___ | ""' ""' |
QQQQQQQQ ~jjjjjjjjjjjjjjjjj__ | |
QQQQQQQQ _jjjjjjjjjjjjjj/~~~~ | The Hippo says: Welcome to |
QQQQQQQQ .{jjjjjjj/~~~~~ | _ |
QQQQQQQQ .{/~~~~` | ____ _ _ ____ _ _ _ (_) ____ |
QQQQQQQQ | / ___)| | | | / _ || | | || || _ \ |
QQQQQQQQ |( (___ | |_| |( (_| || | | || || | | ||
QQQQQQQQQL_______________, | \____) \__ | \___ | \___/ |_||_| |_||
QQQQQQQQQQQQQQQQQQQQQQQQQQQL___ | (___/ (____| |
4QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ___ | |
(=QQQQQQQQQQQQQQQQQQQQQQQQQQQQQ==== | -.-. -.-- --. .-- .. -. |
(QQQQQQQQQQQQQQQQQQQQQQQQF= |______________________________________|
<END hippo.txt>
However, I only want this in an interactive shell, so I test whether PS1
is greater than 0 in size.
if [ ! -z "$PS1" ]
I only want this with a new shell, not a subshell. So I test for the
shell level.
if [ ${SHLVL} = 1 ]
I apologize for the lack of credit for the sources of the graphics; I
don't remember where I found them.
Enjoy!
- Barry
Disclaimer: Statements made herein are not made on behalf of NIAID.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple