Bug 191233 - make tcsh behave like bash
Summary: make tcsh behave like bash
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: setup
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Phil Knirsch
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks: 434561
TreeView+ depends on / blocked
 
Reported: 2006-05-09 22:01 UTC by Jack Neely
Modified: 2015-03-05 01:16 UTC (History)
2 users (show)

Fixed In Version: RHBA-2008-0130
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-03-05 12:30:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0130 0 normal SHIPPED_LIVE setup bug fix and enhancement update 2008-07-23 21:57:38 UTC

Description Jack Neely 2006-05-09 22:01:47 UTC
Description of problem:

When bash starts up as the user's default shell it executes /etc/profile and
hence /etc/profile.d/*.sh.  For non-login shells (say bash -c "echo FOO")
/etc/profile and /etc/profile.d/*.sh are NOT executed.  This is the expected
behavior.

Users that use tcsh as their default shell do not behave in the same way.  The
scripts /etc/profile.d/*.csh are executed for ALL shells.  This is because the
/etc/profile.d/*.csh files are sourced from /etc/csh.cshrc.  They SHOULD be
sourced from /etc/csh.login instead.

This bug is present in all versions of RHEL and Fedora Core.

To reproduce:

1. Create a file "test.csh" (755) in /etc/profile.d containing:
---
#!/bin/tcsh
echo "FOO"
---

2. Login as a user with tcsh as the default shell.  You'll note that "FOO"
appears on your display.

3. Execute a non-login tcsh shell by running: 

   tcsh -c "echo BAR"

The following appears on your screen:

   FOO
   BAR

The expected result should be:

   BAR

Comment 2 Burt Holzman 2007-05-29 16:48:03 UTC
FYI, this inconsistency affected us here recently -- a command was added to
/etc/profile.d (aklog) which was appropriate for login shells, but not for
non-login shells (which get spawned by 'less', for instance).

As Jack suggested, /etc/profile.d/*.csh should get sourced from csh.login (or
should be wrapped with an if ( ${?loginsh} ).


Comment 3 Phil Knirsch 2008-02-22 16:35:43 UTC
Suggesting for RHEL-4.8 with Devel ACK.

Read ya, Phil

Comment 4 Phil Knirsch 2008-02-22 17:05:29 UTC
Still in RHEL-4.7 planing, so reflagging for RHEL-4.7

Read ya, Phil



Comment 5 RHEL Program Management 2008-02-22 17:08:34 UTC
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".

Comment 11 errata-xmlrpc 2008-03-05 12:30:42 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0130.html



Note You need to log in before you can comment on or make changes to this bug.