Bug 74770 - Trailing space required in set prompt lines
Summary: Trailing space required in set prompt lines
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: tcsh
Version: 7.3
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Miloslav Trmač
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-10-01 15:47 UTC by Richard Troxel
Modified: 2007-04-18 16:46 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2004-08-19 16:02:45 UTC
Embargoed:


Attachments (Terms of Use)

Description Richard Troxel 2002-10-01 15:47:24 UTC
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.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 16:02:45 UTC
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.