Bug 434561 - make tcsh behave like bash
make tcsh behave like bash
Status: CLOSED RAWHIDE
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: tcsh (Show other bugs)
5.1
All Linux
low Severity medium
: rc
: ---
Assigned To: Vitezslav Crhonek
Bill Huang
:
Depends On: 191233
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-22 14:19 EST by Jack Neely
Modified: 2008-02-22 14:27 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-02-22 14:27:07 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jack Neely 2008-02-22 14:19:05 EST
+++ This bug was initially created as a clone of Bug #191233 +++

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

-- Additional comment from burt@fnal.gov on 2007-05-29 12:48 EST --
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} ).


-- Additional comment from pknirsch@redhat.com on 2008-02-22 11:35 EST --
Suggesting for RHEL-4.8 with Devel ACK.

Read ya, Phil

-- Additional comment from pknirsch@redhat.com on 2008-02-22 12:05 EST --
Still in RHEL-4.7 planing, so reflagging for RHEL-4.7

Read ya, Phil



-- Additional comment from pm-rhel@redhat.com on 2008-02-22 12:08 EST --
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 1 Jack Neely 2008-02-22 14:27:07 EST
Via #299221 this is included in the next rawhide package

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