[comp.unix.shell] 4.2BSD C Shell Bug List available -- many apply to current C Shells

D. Allen [CGL]" <idallen@watcgl.waterloo.edu> (09/28/90)

While avoiding my Master's Thesis some years ago, I fixed most of the
first-level bugs in 4.2bsd CSH without introducing too many new ones. 
But now, people who are used to a less buggy CSH here are leaving and
getting burned in the real world.  So it doesn't pay to fix the bugs
since it makes people think C Shells are reasonable shells.  They aren't.

If BASH allowed aliases to contain aliases, I think I'd use it instead.

Anonymous ftp to watcgl.waterloo.edu file CSHbugs.Z (35K compressed).

Some samples from CSHbugs.Z:
---
From idallen(Ian! D. Allen)
Subject: CSH does extra nest level when nested IF line ends in THEN
    We all know that you need blanks around your keywords when you nest if
    statements, but did you know that any IF line that ends in THEN is
    taken as another nesting level, and requires a corresponding ENDIF?

	if ( 0 ) then
	    if ( 0 ) echo This line ends with then
	endif
	endif # This shouldn't be needed; but it is.

From idallen
Subject: CSH oddities with quoted command names and path searching
	% unset path
	% /bin/date
	Thu Jan 26 16:06:02 EST 1984
	% "/bin/date"
	Thu Jan 26 16:06:06 EST 1984
	% set path=/etc
	% /bin/date
	Thu Jan 26 16:06:24 EST 1984
	% "/bin/date"
	/bin/date: Command not found.

    The addition of a search path turns a valid absolute file name into
    an unrecognized one.  Ugh.  Fixed.

From: idallen (Ian! D. Allen)
Subject: CSH peculiarities of path searching
	% cd /dev ; set path=/
	% bin/date
	bin/date: Command not found
	% "bin/date"
	Sat Mar 24 18:59:23 EST 1984
	% bin\e/date
	Sat Mar 24 18:59:29 EST 1984

    The quoting of the "/" makes CSH think it's not there, so it does a
    path search with the string "bin/date" and finds "/bin/date".

From: idallen (Ian! D. Allen)
Subject: CSH peculiarities of path searching
	% cd /dev ; set path=/bin
	% `echo date`
	Sun Mar 25 09:50:16 EST 1984
	% `/bin/echo date`
	date: Command not found

    The shell thinks the slash in /bin/echo is part of the command name,
    and it thus uses an absolute path name and won't search $path.

From: idallen (Ian! D. Allen)
Subject: CSH peculiarities of path searching
    If the CSH uses GLOB to expand a command name, it won't search $path
    for it.  This means that even if you don't have "." in your $path,
    if you type a name that expands with GLOB, you can execute a command
    in the current directory.  For example:
	% set path=/dev ; cd /bin
	% date
	date: Command not found
	% dat?
	Sun Mar 25 09:57:48 EST 1984
    However, if in addition to the GLOB expansion, you add part of the
    name from `...`, the path name is again forced to be looked up in the
    $path.  "da?e" is absolute; "da?`echo e`" is relative; and
    "da?`/bin/echo e`" is again absolute (because of the '/' in /bin/echo!).

-- 
-IAN! (Ian! D. Allen) idallen@watcgl.uwaterloo.ca idallen@watcgl.waterloo.edu
 [129.97.128.64]  Computer Graphics Lab/University of Waterloo/Ontario/Canada