public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Cyrille Lefevre <cyrille.lefevre-lists@laposte.net>
To: cygwin@cygwin.com
Subject: Re: Display a starting message
Date: Sat, 02 Jun 2012 01:46:00 -0000	[thread overview]
Message-ID: <4FC9709E.2030800@laposte.net> (raw)
In-Reply-To: <0105D5C1E0353146B1B222348B0411A20A770AB428@NIHMLBX02.nih.gov>

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.Lefevre-lists@laposte.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

  reply	other threads:[~2012-06-02  1:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-28 19:01 Shravan1804
2012-05-28 21:07 ` Eliot Moss
2012-05-29  2:41   ` Buchbinder, Barry (NIH/NIAID) [E]
2012-06-02  1:46     ` Cyrille Lefevre [this message]
2012-05-30 18:44   ` Shravan1804
2012-05-30 18:46     ` Shravan1804

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FC9709E.2030800@laposte.net \
    --to=cyrille.lefevre-lists@laposte.net \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).