\documentclass[]{article}
\usepackage{amsmath,graphicx,supertabular,hyperref,tabularx,ifthen}
\title{TIP \#151: Remove -e: Command Line Option from tclsh and wish}
\date{August 22, 2003}
\author{Don Porter, Don Porter, Donal K. Fellows}
\urlstyle{sf}
\setlength{\parskip}{1ex}
\setlength{\parindent}{0pt}
\def\tipversion$#1${\texttt{\$#1\$}}
\def\tiplangle#1{\ensuremath{<}}
\def\tiprangle#1{\ensuremath{>}}
\def\tipbar#1{\ensuremath{|}}
\def\tipmail#1#2{\(\langle\){\small\expandafter\url{#1@#2}}\(\rangle\)}
\ifx\pdfoutput\undefined
\newcommand{\tipimage}[2]{\typeout{Make sure you download #1.eps}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.eps}}{\includegraphics[width=0.8\textwidth]{#1.eps}}}
\newcommand{\tipxref}[1]{}
\newcommand{\tipxrefend}{}
\else
\newcommand{\tipimage}[2]{\typeout{Make sure you create #1.pdf}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.pdf}}{\includegraphics[width=0.8\textwidth]{#1.pdf}}}
\pdfcatalog{/PageMode /UseOutlines}
\newcommand{\tipxref}[1]{\pdfannotlink attr {/C [0.5 0.5 1.0] /Border [0 0 1]} goto name {#1}}
\newcommand{\tipxrefend}{\pdfendlink}
\fi
\newenvironment{tipabstract}{\begin{abstract}}{\end{abstract}}
\begin{document}\maketitle
\begin{center}\begin{tabularx}{\linewidth}{|r@{: }X|}\hline
\textbf{TIP \#151}&\textbf{Remove -e: Command Line Option from tclsh and wish}\\\hline
Author&

Don Porter \tipmail{dgp}{users.sourceforge.net}
\par
Don Porter \tipmail{dgp}{users.sf.net}
\par
Donal K. Fellows \tipmail{donal.k.fellows}{man.ac.uk}
\\
Created&Friday, \(\text{22}^{\text{nd}}\) August 2003\\
Type&Project\\
Tcl Version&\(8.5\)\\
State&Final\\
Vote&Done\\
Version&\tipversion$Revision: 1.7 $\\
Post History&\\
\hline\end{tabularx}\end{center}
\thispagestyle{empty}\pagestyle{empty}
\begin{tipabstract}

This TIP proposes removal of the -e: command line option to tclsh and wish that was Accepted as part of \cite{tip137}.
\end{tipabstract}
\tableofcontents\setcounter{page}{0}\clearpage\pagestyle{plain}

\section{Background}

\cite{tip137} was Accepted today. However, there were a few NO votes objecting to the new \textit{-e:} form of the \textit{-encoding} command line option for specifying the encoding of a startup script to tclsh and wish. Those voting NO only objected to that part of \cite{tip137} while supporting the rest as a solid proposal that will improve Tcl. Among those voting YES, no one explicitly embraced the \textit{-e:} command line option as something they required. Some voting YES opined that the \textit{-e:} option was a wart that could be fixed later.

Based on those comments, \cite{tip137} would have been better had the \textit{-e:} form of the command line option not been part of the proposal. This TIP proposes nothing more than removing Acceptance of the \textit{-e:} form of the \textit{-encoding} command line option.

Without the controversial \textit{-e:} proposal, I believe \cite{tip137} would have had unanimous approval.

\section{Rationale}

The use of \textit{-e:} as a command line option to tclsh or wish suffers when compared with the perl program. The \textit{perl -e} option for evaluation of a Perl script provided on the command line is very well known, and it's a mistake to add something to tclsh that looks similar, but is in fact very different.

\cite{tip137} proposed both \textit{-encoding} and the \textit{-e:} form. There's really no need to add multiple ways to do the same thing.

The Rationale in \cite{tip137} for the \textit{-e:} form is solely to support the 32-character limit in some Unices for their \textit{\#!} lines. However, the \textit{-e:} form does not really solve that problem. For example:
\begingroup\small\begin{verbatim}
 #!/usr/local/bin/tclsh8.5 -e:iso8859-15 
 12345678901234567890123456789012
\end{verbatim}
\endgroup

Here we see that we still run afoul of the 32-character limit when tclsh is installed in the default location. Even longer encoding names exist which magnify the problem, and altering the installation location will not necessarily help:
\begingroup\small\begin{verbatim}
 #!/usr/bin/tclsh8.5 -e:iso8859-15 
 12345678901234567890123456789012
\end{verbatim}
\endgroup

(This is actually an insidious failure mode in that it leads to the script being sourced with a valid but incorrect encoding.)

Conversely, we already have an effective general workaround for the 32-character limit problem:
\begingroup\small\begin{verbatim}
 #!/bin/sh
 # \
 exec tclsh -encoding iso8859-15 "$0" ${1+"$@"}
\end{verbatim}
\endgroup

So, \textit{-e:} doesn't solve a problem we don't really have, and it's controverisal. We should remove it.

\section{Proposal}

Remove (Acceptance of) the \textit{-e:} set of command line options to the programs \textit{tclsh} and \textit{wish}.

\section{Compatibility}

Since no version of Tcl or Tk has been released supporting the \textit{-e:} command line option, there are no compatibility issues to resolve.

\section{Copyright}

This document is placed in the public domain.

\section{Colophon}

\textit{TIP AutoGenerator --- written by Donal K. Fellows}
\begin{thebibliography}{TIP \#1}
\addcontentsline{toc}{section}{References}
\bibitem[TIP \#137]{tip137}
Anton Kovalenko,
\emph{Specifying Script Encodings for [source] and tclsh},
on-line at \url{http://purl.org/tcl/tip/137.html}
\end{thebibliography}
\end{document}
