Bug 1756535

Summary: " if: Expression Syntax. " error when logging in if default shell is /bin/tcsh due to incorrect syntax in tcsh login script
Product: Red Hat Enterprise Linux 7 Reporter: Paul Burke <thellama000>
Component: kde-settingsAssignee: Jan Grulich <jgrulich>
Status: CLOSED DUPLICATE QA Contact: Desktop QE <desktop-qa-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.7   
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-30 05:24:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Paul Burke 2019-09-27 21:18:18 UTC
Description of problem:

When users have /bin/tcsh set as their default shell and log in to a terminal on RHEL 7.7, they receive the message "if: Expression Syntax." before their terminal prompt.  I traced this to an improperly formatted if statement in /etc/profile.d/kde.csh 

if [ ! -d ${HOME}/.local/share -a -w ${HOME} ] then
mkdir -p ${HOME}/.local/share


tcsh appears to error out on the square brackets ( [] ) in this script, as they are not syntactically correct.  A machine kickstarted on 7.2 does not present this error, but one found kickstarted on 7.7 and possibly some other releases between 7.2 and 7.7 appear to have this problem.  I found that the file is provided by the kde-settings package

Version-Release number of selected component (if applicable):
7.7, possibly sooner

How reproducible:
Every attempt, if the improperly formatted /etc/profile.d/kde.csh is present

Steps to Reproduce:
1. set user's default shell to /bin/tcsh
2. log in via SSH or open the terminal
3. alternatively, use "tcsh -l" to start a tcsh login session

Actual results:
Prompt shows the following upon login/running the "tcsh -l" command

if: Expression Syntax.
[user@hostname ~]$ 

Expected results:
User is simply presented with a prompt

[user@hostname ~]$ 

Additional info:
The machine kickstarted on 7.2 has since been updated through all point releases to 7.7 and all releases of kde-settings, but does not have the misconfigured .csh script

Comment 2 Jan Grulich 2019-09-30 05:24:08 UTC

*** This bug has been marked as a duplicate of bug 1738491 ***