X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL,BAYES_05,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,SPF_HELO_PASS,TW_JG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org X-IronPortListener: Outbound_SMTP X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhoFANbrw0+cKEcV/2dsb2JhbABEsW6DcoEHghcBAQEEEihPAgEIDQscAhAfEyUBAQQbGodpnAScF4sDhF9gA4x4jhCKAIJ8 From: "Buchbinder, Barry (NIH/NIAID) [E]" To: "cygwin AT cygwin DOT com" Date: Mon, 28 May 2012 17:21:37 -0400 Subject: RE: Display a starting message Message-ID: <0105D5C1E0353146B1B222348B0411A20A770AB428@NIHMLBX02.nih.gov> References: <33921015 DOT post AT talk DOT nabble DOT com> <4FC3CB7E DOT 50900 AT cs DOT umass DOT edu> In-Reply-To: <4FC3CB7E.50900@cs.umass.edu> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q4SLM3nL015280 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 ____________________, ______________________________________ .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= |______________________________________| 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