help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bash Library


From: Marco Ippolito
Subject: Re: Bash Library
Date: Wed, 3 Sep 2025 10:42:26 +0200
User-agent: Mozilla Thunderbird

On 21/04/2021 23:43, Greg Wooledge wrote:
On Wed, Apr 21, 2021 at 11:34:20PM +0200, steve-humphreys@gmx.com wrote:
In summary, one has to include the path to "lantern.sh" to set the other
parts.

source ~/Admir/build/decun/lantern.sh

The problem I want to discuss is the situation when other users install
the library in some other path.  They would have to change the hardwired
path "~/Admir/build/decun/lantern.sh".  This means that they cannot
simply run my scripts by calling "test.sh".  What is the least cumbersome
way to deal with this?

The path ~/Admir/build/decun/ is obviously unique to your development
setup, and should not appear in a finished script that you expect other
people to be using.

If you expect people to deploy this within their home directories, you
should decide on a location within $HOME that would make sense for
most of your users to converge on.  $HOME/bin/lantern.sh would not be
a terrible choice.  You could use that, or something similar.

You could also use something like: $HOME/.local/bin/.

According to:
https://specifications.freedesktop.org/basedir-spec/latest/

"""
User-specific executable files may be stored in $HOME/.local/bin. Distributions should ensure this directory shows up in the UNIX $PATH environment variable, at an appropriate place.
"""

Then, copy or symlink lantern.sh to that location on your own system so
that your testing will pick it up.  Change all references to it within
the script(s) that you're writing to the new standard location.  Document
the standard location in the installation instructions that you give
to your users.

Any user who doesn't like this location is free to modify the scripts
themselves, or create a symlink from the standard location to wherever
they decide to put it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]