At Fri, 22 Mar 2019 10:16:56 -0500 Richard Owlett <
row...@cloud85.net> wrote:
>
> On 03/22/2019 09:43 AM, Harald Oehlmann wrote:
> > Am 22.03.2019 um 15:19 schrieb Richard Owlett:
> >> I am using Tcl/Tk 8.6 on a Debian Stretch system wit the MATE desktop
> >> environment.
> >>
> >> I have downloaded a Tcl script , marked it as executable, placing it
> >> several levels below /home.
> >>
> >> If I use Caja to browse to that sub-directory and then double-click
> >> either "Run in terminal" or "Run", it executes as expected.
> >>
> >> HOWEVER, execution fails if run by:
> >> 1. Opening a MATE Terminal window.
> >> =C2=A0=C2=A0 Attempting to run by entering either
> >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "/home/richard/apath/test.tcl"
> >> =C2=A0=C2=A0 or
> >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "tclsh /home/richard/apath/test.tcl"
> >> 2. Creating a MATE Launcher with either of the above strings entered
> >> =C2=A0=C2=A0 in the Command box.
> >>
> >>
> >> What is the difference in "execution environment" between what works
> >> and what doesn't?
> >> The symptom is that it can not find a existing data file, suggesting
> >> a "path" related issue.
> >>
> >> I wish to use a MATE Launcher.
> >> Modifying the script is *NOT* feasible.
> >> Suggestions?
> >> TIA
> >>
> >>
> >=20
> > I suppose, showing the first line of the script may shed some light.
> > May you share just the first line in the script file ?
> > There might be a shebang (#!...).
> >=20
> > Thank you,
> > Harald
> >=20
>
> You proved I know even less about Tcl than I thought ;{
> The first three lines are
> #!/bin/sh
> # the next line restarts using tclsh \
> exec tclsh "$0" "$@"
>
> Actually the script is nut.tcl from NUTsqlite
> [
http://nut.sourceforge.net/].
>
> What should I have read?
Replace the first three lines with this one line:
#!/usr/bin/tclsh
(assuming tclsh is in fact in /usr/bin, if it is somewhere else, you need to
put that in).
*Alternitively* did you try to put in the exact and *complete* absolute path
to tclsh in the Launcher command line (not just "tclsh", but the *full* abs.
path, starting with "/").
The "hack" they are using is meant for people from from the command line who
might have tclsh installed someplace odd, but who have arranged for their
pathlist ($PATH) to include that location. Running from a Desktop launcher is
probably not going to have the $PATH variable set up properly (if set up at
all) for that sort thing (not unless you are really, really clever about
setting up your desktop), so you need the script to have the proper location
"hard wired" into the script in order for it to work.
>
> Thanks.