RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1410903 - tcsh -e flag is broken
Summary: tcsh -e flag is broken
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tcsh
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: David Kaspar // Dee'Kej
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-06 19:32 UTC by Angelo Bonet
Modified: 2017-02-13 01:44 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-13 01:44:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Angelo Bonet 2017-01-06 19:32:42 UTC
Description of problem:

tcsh's -e flag prevents shell operation

Version-Release number of selected component (if applicable):

tcsh-6.18.01-8.el7.x86_64

How reproducible:

Always 

Steps to Reproduce:
1.  
# Create a script:
% echo "echo hello" > script.csh

2. 
# Run script with tcsh -e
% tcsh -e ./script.csh

3.
# See nothing at all

Actual results:

% 

Expected results:

% hello

Additional info:

It appears that starting with RHEL7, the -e flag to tcsh just renders the entire shell inoperable.

That switch is designed to force the shell to exit when a command returns non-zero exit status, but it now causes the shell to do nothing (other then exit with status 2).

This works as expected on RHEL6: tcsh-6.17-35.el6_8.1.x86_64 and RHEL5: tcsh617-6.17-7.el5

Observed that it's also broken on Fedora 24's tcsh-6.19.00-10.fc24.x86_64

Comment 2 Angelo Bonet 2017-01-09 16:01:24 UTC
I was going to open an upstream bug report, but discovered this may be an issue limited to running tcsh on RHEL7.

I've downloaded several upstream versions of tcsh (e.g. 6.18.01, 6.19, 6.20) and built them on both RHEL 6.8 and 7.3.

The RHEL 6 builds work fine with -e, but fail on RHEL 7.

Comment 3 Angelo Bonet 2017-01-11 22:11:26 UTC
Feel free to close this report as NOTABUG.  

The is not a problem with tcsh, it's the fact that the "-e" flag is being used without the "-f" flag.  This is causing "-e" to operate on the initialization scripts and (on our particular RHEL7 host) there is a 'grep' command up in /etc/profile.d/ksh.csh that exists with status 2.  

Due to -e, this causes the tcsh invocation to exit with status 2 -- well before the users script is ever invoked -- just as it should.

In our case, RHEL6 doesn't have any commands up in /etc/profile.d/*.csh that exit with a non-zero status -- so it skates through that code without a problem.

Comment 4 David Kaspar // Dee'Kej 2017-02-13 01:44:07 UTC
(In reply to Angelo Bonet from comment #3)
> Feel free to close this report as NOTABUG.  
> 
> The is not a problem with tcsh, it's the fact that the "-e" flag is being
> used without the "-f" flag.  This is causing "-e" to operate on the
> initialization scripts and (on our particular RHEL7 host) there is a 'grep'
> command up in /etc/profile.d/ksh.csh that exists with status 2.  
> 
> Due to -e, this causes the tcsh invocation to exit with status 2 -- well
> before the users script is ever invoked -- just as it should.
> 
> In our case, RHEL6 doesn't have any commands up in /etc/profile.d/*.csh that
> exit with a non-zero status -- so it skates through that code without a
> problem.

Thank you very much, Angelo, for reporting this change in behaviour between RHEL6 and RHEL7. I wasn't aware of it, this might come in handy in the future. Much appreciated.

Best regards,

David


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