Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
From: Mark Gordon <mark.cygwin@ruddygore.net>
To: cygwin@sources.redhat.com
Subject: Re: output allowed in .bashrc and .tcshrc (Was: Virus Found)
Date: Tue, 11 Sep 2001 10:51:09 +0100
Organization: Only Occasionally
Message-ID: <66nrptktu176g170pqudpgf47697rp1dn5@4ax.com>
References: <20010911004146.H937@cygbert.vinschen.de> <8F23E55D511AD5119A6800D0B76FDDE101A26A59@cpex3.channelpoint.com> <59jqpt4f25eochmtlslvv9nodngnkeeo3d@4ax.com> <5.1.0.14.2.20010911020929.00ac0fc0@imap.local.mscha.com> <20010911111946.A1285@cygbert.vinschen.de> <7996-Tue11Sep2001104432+0100-starksb@ebi.ac.uk>
In-Reply-To: <7996-Tue11Sep2001104432+0100-starksb@ebi.ac.uk>
X-Mailer: Forte Agent 1.8/32.553
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id FAA16453

On Tue, 11 Sep 2001 10:44:32 +0100, David Starks-Browning
<starksb@ebi.ac.uk> wrote:

>On Tuesday 11 Sep 01, Corinna Vinschen writes:
>> ... If your login shell is bash and bash has been started by
>> rshd/sshd, it executes ~/.bashrc.  So the rule is, no output in
>> ~/.bashrc.
>> 
>> And, IIRC, the same rule applies for tcsh and ~/.cshrc.
>
>Just to be precise and complete...
>
>That's almost correct.  Your *are* allowed to generate output in
>.bashrc (and in .cshrc for tcsh) for *interactive* shells only.  The
>usual way to test is to check for the existence of a prompt.  ($PS1 in
>bash, $prompt in tcsh.)  If no prompt is defined, you must not
>generate *any* output.

On the SCO box I have here with tcsh the same applies to
/etc/csh.cshrc (I just tested this).

You can (on this system at least) get away with calling stty on
non-interactive shells, although it does generate an error so one
probably should not.

Unfortunately on this SCO box (which I did not set up) it was doing
ALL of the things it should not!
-- 
Mark Gordon - To email me replace spamtrap with mark.gordon
	A clean desk is a sign of a cluttered desk drawer.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

