delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/06/01/21:46:30

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,SARE_FREE_WEBM_LAPOSTE,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4FC9709E.2030800@laposte.net>
Date: Sat, 02 Jun 2012 03:47:10 +0200
From: Cyrille Lefevre <cyrille DOT lefevre-lists AT laposte DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.3) Gecko/20070326 Thunderbird/2.0.0.0 Mnenhy/0.7.5.666
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Display a starting message
References: <33921015 DOT post AT talk DOT nabble DOT com> <4FC3CB7E DOT 50900 AT cs DOT umass DOT edu> <0105D5C1E0353146B1B222348B0411A20A770AB428 AT NIHMLBX02 DOT nih DOT gov>
In-Reply-To: <0105D5C1E0353146B1B222348B0411A20A770AB428@NIHMLBX02.nih.gov>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q521kOde027808

Le 28/05/2012 23:21, Buchbinder, Barry (NIH/NIAID) [E] a écrit :

> 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

pretty, how about this one :-)

if [[ -w /etc/sshd_config ]]; then
	perl -pi -e 's/^#// if /PrintMotd/;
		     s/yes/no/ if /PrintMotd/' /etc/sshd_config
	net stop sshd; net start sshd
fi
cat << 'EOF' > /etc/profile.d/banner.sh
sed -e 's/ The .* to /\x1B[33;44;5m&\x1B[0;37;44m/' \
     -e 's/|\(.*\)|$/\x1B[0;1m|\x1B[44m\1\x1B[1;40m|\x1B[0m/' \
     -e '/./s/^/\x1B[0;32m/' -e 's/ __*$/\x1B[0;1m&\x1B[0m/' \
     -e 's/jgs/\x1B[1;34;44mjgs\x1B[1;37;44m/' /etc/motd
EOF

PS : [ ! -z $PS1 ] == [ -n $PS1 ], $SHLVL is bash only

Regards,

Cyrille Lefevre
-- 
mailto:Cyrille DOT Lefevre-lists AT laposte DOT net


--
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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019