[930] 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

daemon@ATHENA.MIT.EDU (Anders Kaseorg)
Fri Jan 23 03:13:49 2009

Date: Fri, 23 Jan 2009 03:12:49 -0500 (EST)
From: Anders Kaseorg <andersk@MIT.EDU>
To: Kimmo Suominen <kimmo@suominen.com>
cc: tcsh-bugs@mx.gw.com, debathena@mit.edu
In-Reply-To: <20090123073524.GV11650@kimmo.suominen.com>
Message-ID: <alpine.DEB.2.00.0901230258001.27161@vinegar-pot.mit.edu>
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="-1257098496-1544634899-1232698369=:27161"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

---1257098496-1544634899-1232698369=:27161
Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Fri, 23 Jan 2009, Kimmo Suominen wrote:
> 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.

Correct.  That=E2=80=99s why my report is about scripts, not interactive us=
e.=20
This problem most commonly bites our users on files like ~/.tcshrc.

> 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.

Whether all text files must be newline-terminated is a matter of debate,=20
but it is true that tcsh has every right to believe that all valid tcsh=20
scripts must be.  In that case, tcsh should display a syntax error if it=20
encounters a script that is not properly terminated, just as with any=20
other invalid script, rather than silently discarding the trailing=20
characters.  That would be enough for a confused user to figure out what=20
went wrong.

Anders
---1257098496-1544634899-1232698369=:27161--

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