Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 74770 - Trailing space required in set prompt lines
Trailing space required in set prompt lines
Product: Red Hat Linux
Classification: Retired
Component: tcsh (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Miloslav Trmač
Depends On:
  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:
Last Closed: 2004-08-19 12:02:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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

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

How reproducible:

Steps to Reproduce:
1. Remove the trailing ' ' characters from the 2 "set prompt =" lines in
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:

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]$ '
    set prompt=\[`id -nu`@`hostname -s`\]\$\

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]$ '
    set prompt=\[`id -nu`@`hostname -s`\]\$ endif

which is indeed missing an endif.

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