[929] in athena10

home help back first fref pref prev next nref lref last post

Re: tcsh silently ignores the end of a script with no trailing newline

daemon@ATHENA.MIT.EDU (Kimmo Suominen)
Fri Jan 23 02:36:03 2009

Date: Fri, 23 Jan 2009 09:35:24 +0200
To: Anders Kaseorg <andersk@mit.edu>
Cc: tcsh-bugs@mx.gw.com, debathena@mit.edu
Message-ID: <20090123073524.GV11650@kimmo.suominen.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.00.0901221924230.11108@vinegar-pot.mit.edu>
From: Kimmo Suominen <kimmo@suominen.com>
Mail-Followup-To: andersk@MIT.EDU, tcsh-bugs@mx.gw.com,
	debathena@mit.edu

Tcsh should not execute characters in the buffer when it encounters
an EOF.

Just imagine that you were typing in a command to the prompt, when
suddenly your connection to the host is broken.  You don't want
the incomplete command to be interpreted and executed.

Normal text files, by definition, have newline characters at the
end of each line, including the last one.  You can probably configure
your editor to work correctly.

Best regards,
+ Kimmo
-- 
<A HREF="http://kimmo.suominen.com/">Kimmo Suominen</A>


On Thu, Jan 22, 2009 at 07:33:42PM -0500, Anders Kaseorg wrote:
> balanced-tree:/tmp> printf 'echo hi\n' > file1
> balanced-tree:/tmp> printf 'echo hi' > file2
> balanced-tree:/tmp> tcsh file1
> hi
> balanced-tree:/tmp> tcsh file2
>
> This has caused confusion for users on a system with tcsh as the default  
> shell, when they attempt to edit their dotfiles using editors that do not 
> add a trailing newline by default.
>
> Anders


home help back first fref pref prev next nref lref last post