I'd approach it this way:

set -e   # exit on error
cd "$(dirname "$0")"

Hostile symbolic links in a user's install directory should only be a
problem on shared machines with irresponsible users. That said, I
suppose this could be an issue on a college campus, so perhaps the cd
line should be:

cd -P "$(dirname "$0")"

I think all posix shells support the -P option for cd.

FYI,

-- 
Raul

On Thu, Mar 2, 2023 at 6:06 AM bill lam <bbill....@gmail.com> wrote:
>
> I think that readlink is not guaranteed to be installed by default on linux
> or other *nix.
>
> On Thu, 2 Mar 2023 at 6:34 PM 'Viktor Grigorov' via Programming <
> programm...@jsoftware.com> wrote:
>
> > Minor quip: the shell script in the general linux zip 'bin/install-usr.sh'
> > should include this line near the top
> >
> > cd "$(dirname "$(readlink -f "$0")")" || exit;
> >
> > or one to the same same, I'm not familiar with posix sh word splitting so
> > I overdo the quotes, hopefully not the opposite effect. This allows the
> > script to run from without top level of the j dir.
> >
> >
> > Mar 2, 2023, 08:38 by bbill....@gmail.com:
> >
> > > j9.4.1 for android  is available at
> > >
> > > https://www.jsoftware.com/download/j9.4/install/
> > >
> > >
> > >
> > >
> > > On Thu, Mar 2, 2023 at 1:49 AM Eric Iverson <eric.b.iver...@gmail.com>
> > > wrote:
> > >
> > >> j9.4.1 release is available!
> > >>
> > >> https://code.jsoftware.com/wiki/System/Installation/J9.4
> > >>
> > >> Zip installs are there now and AIO/Debian/apk will be there shortly.
> > >>
> > >> Do a full install. You can do this on top of an existing j9.4 folder,
> > but
> > >> probably better to rename it out of the way and start with a clean
> > slate.
> > >>
> > >> Name convention has changed (j904 -> j9.4), so the user folder is:
> > >> j9.4-user.
> > >>
> > >> Do not just upgrade the JE as you did with the beta as this may not
> > give a
> > >> clean and complete installation.
> > >>
> > >> ***
> > >> If you were on the beta journey you will know that this is a big step
> > for
> > >> J.
> > >>
> > >> J now has a threading model ready for serious use. This is going to take
> > >> time to settle in, but is going to change the way we tackle some
> > problems.
> > >>
> > >> Roger's original implementation of rationals and extended integers was
> > >> always intended as a placeholder. Many years later, we have finally
> > moved
> > >> to GMP. No new capabilities, but the performance improvement can be a
> > game
> > >> changer. The hobby horse is now a work horse.
> > >>
> > >> Improved error messages will be appreciated by new users, but are also
> > >> welcomed by old hands. This feature is extensible and will evolve.
> > >>
> > >> Release Notes are worth a look:
> > >> https://code.jsoftware.com/wiki/System/ReleaseNotes/J9.4
> > >>
> > >> This was a team effort and benefited from significant community
> > >> participation. But we should all recognize the major contributions of a
> > few
> > >> individuals.
> > >>
> > >> Henry Rich (everything - especially threads)
> > >> Raul Miller (GMP)
> > >> Bill Lam (steady hand in everything - android/openbsd/freebsd)
> > >> Elijah Stone (threads and error messages)
> > >> Bill Heagy (testing/testing/testing - beyond value)
> > >> ----------------------------------------------------------------------
> > >> For information about J forums see http://www.jsoftware.com/forums.htm
> > >>
> > > ----------------------------------------------------------------------
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > >
> >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to