[Discuss] Program path maintenance and security (was Re: Debian 12 vs. WSL 1)

Rich Pieri richard.pieri at gmail.com
Thu Jun 22 23:15:47 EDT 2023


On Thu, 22 Jun 2023 20:07:38 -0500
Derek Martin <invalid at pizzashack.org> wrote:

> I'm not sure what nonsense you mean--I'm still waiting for you to
> refute a single point I made with actual facts, but I'm glad you're
> enjoying yourself. :)

----------%< cut here %<----------
#!/bin/sh

# Little bit of code to identify the OS goes here.
# I can't find my old osname script, but looking at the output from
# uname is a good place to start if you want to try this at home.

case $OS in
  sunos4)  PERL=/usr/bin/perl;;
  solaris) PERL=/opt/bin/perl;;
  ultrix)  PERL=/usr/local/bin/perl;;
  aix)     PERL=/opt/local/bin/perl;;
  netbsd)  PERL=/usr/pkg/bin/perl;;
esac

exec $PERL $HOME/bin/myscript.pl $*
----------%< cut here %<----------

The assertions you made: Need PATH, or symlinks, or env, or multiple
copies of program with different names, or I'm SoL. Here is one
program, and one wrapper, that work everywhere without using PATH or
symlinks or env.

You're welcome.

-- 
\m/ (--) \m/


More information about the Discuss mailing list