On Fri, 22 Sep 2000, Eric Taylor wrote:
>
> couple of ???
>
> 1. I see the file output in 1.2.2 now has
>
>
> #!/bin/sh
> # the next line restarts using wish\
> exec wish8.0 "$0" "$@"
> #############################################################################
The proper incantation is:
#!/bin/sh
# the next line restarts using wish \
exec wish8.0 "$0" ${1+"$@"}
(Can the maintainer fix it?)
> What is the purpose of this? Is it optional? Is it needed?
>
> and what does the trailing \ on the "# the next ..." do, does it
> continue the comment and 'eat' up the 3rd line?
man wish:
SCRIPT FILES
If you create a Tcl script in a file whose first line is
#!/usr/local/bin/wish
then you can invoke the script file directly from your
shell if you mark it as executable. This assumes that
wish has been installed in the default location in
/usr/local/bin; if it's installed somewhere else then
you'll have to modify the above line to match. Many UNIX
systems do not allow the #! line to exceed about 30 char-
acters in length, so be sure that the wish executable can
be accessed with a short file name.
An even better approach is to start your script files with
the following three lines:
#!/bin/sh
# the next line restarts using wish \
exec wish "$0" "$@"
This approach has three advantages over the approach in
the previous paragraph. First, the location of the wish
binary doesn't have to be hard-wired into the script: it
can be anywhere in your shell search path. Second, it
gets around the 30-character file name limit in the previ-
ous approach. Third, this approach will work even if wish
is itself a shell script (this is done on some systems in
order to handle multiple architectures or operating sys-
tems: the wish script selects one of several binaries to
Tk 4.3 3
wish(1) Tk Applications wish(1)
run). The three lines cause both sh and wish to process
the script, but the exec is only executed by sh. sh pro-
cesses the script first; it treats the second line as a
comment and executes the third line. The exec statement
cause the shell to stop processing and instead to start up
wish to reprocess the entire script. When wish starts up,
it treats all three lines as comments, since the backslash
at the end of the second line causes the third line to be
treated as part of the comment on the second line.
...RickM...
_______________________________________________
vtcl-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/vtcl-user