[1855] in RedHat Linux List

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

minor item: closure on tkman problem

daemon@ATHENA.MIT.EDU (bilker@bigfoot.com)
Wed Oct 30 13:25:19 1996

Date: Wed, 30 Oct 1996 10:08:42 -0800
To: redhat-list@redhat.com
From: bilker@bigfoot.com
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com


I, and at least one other, have had problems with `tkman'.  As distributed,
this is a csh script that immediately exec's `wish'.  The bit of syntax that
enables this two-tier initialization scheme is that backslash at the end
of a comment line in tcl _continues_ the comment on the next line, but
not in csh.  Hence, tkman begins:

#! /bin/csh -f
# the next line restarts using wish \
exec /usr/bin/wish $0 $*
set manx(version) 1.7.3


Csh executes the `exec' line, which feeds the same file to `wish'.  Wish
views the `exec' line as a continuation of the comment line.

Unfortunately, the 4.0 distribution has a *pair* of backslashes:

          # the next line restarts using wish \\

which apparently negates the comment-extending ability of the backslash.
Hence, `wish' attempts to execute the `exec' line, and barfs on the $0
notation.

In an earlier post I noted that tkman can be made to work by changing the
first few lines to:

#! /usr/bin/wish
set manx(version) 1.7.3


I now report that simply removing one of the backslashes on the comment
line also restores functionality, and this is probably the preferred
fix.  (Be sure that there are no blank or tab characters following the
backslash!)  [A gracious gentleman e-mailed me the appropriate reference:
page 12 of Brent. B. Welch's book "Practical Programming in Tcl and Tk".
I've clumsily deleted his mail, so I cannot attribute this kind gesture
by name.]

Bill Kerr


--
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
  ________________________________________________________________________
  http://www.redhat.com/RedHat-FAQ   http://www.redhat.com/RedHat-Errata
  http://www.redhat.com/RedHat-Tips  http://www.redhat.com/mailing-lists
  ------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null


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