Bug 74770 - Trailing space required in set prompt lines
Trailing space required in set prompt lines
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: tcsh (Show other bugs)
7.3
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Miloslav Trmač
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-10-01 11:47 EDT by Richard Troxel
Modified: 2007-04-18 12:46 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-08-19 12:02:45 EDT
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 Richard Troxel 2002-10-01 11:47:24 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; SunOS 5.7 sun4u)

Description of problem:
RedHat's /etc/csh.cshrc includes two "set prompt =" lines.  Each ends with a
trailing space.  If the trailing whitespace is edited out, syntax errors "then:
then/endif not found." appear, e.g. in the context of logging into a tcsh
account using OpenSSH.  IMHO tcsh should not be sensitive to the absence of this
whitespace.

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


How reproducible:
Always

Steps to Reproduce:
1. Remove the trailing ' ' characters from the 2 "set prompt =" lines in
/etc/csh.cshrc
2. From another host, ssh this.redhat.host date
3. This assumes your account uses tcsh (I didn't try csh)
	

Actual Results:  rick@this.redhat.host's password:
then: then/endif not found.
[ shell prompt appears ]

Expected Results:  No cryptic, unsettling syntax diagnostic

Additional info:

setup-2.5.12-1
tcsh-6.10-6
Comment 1 Miloslav Trmač 2004-08-19 12:02:45 EDT
In the fragment in question:

if ($?prompt) then
  if ($?tcsh) then
    set prompt='[%n@%m %c]$ '
  else
    set prompt=\[`id -nu`@`hostname -s`\]\$\
  endif
endif

The first space can be removed with no adverse effects.
The second space is preceded by \; if you remove the space, it is
backslash-newline and the line is concatenated with the following one,
in effect becoming

if ($?prompt) then
  if ($?tcsh) then
    set prompt='[%n@%m %c]$ '
  else
    set prompt=\[`id -nu`@`hostname -s`\]\$ endif
endif

which is indeed missing an endif.

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