Fwd: execline and $0-based stuff

From: Avery Payne <avery.p.payne_at_gmail.com>
Date: Tue, 21 Feb 2017 10:35:10 -0800

On Sat, Feb 18, 2017 at 4:46 AM, <gperreal_at_free.fr> wrote:

> Hello there,
> I would like to extract a part of the path of the executed script ($0) in
> a variable, e.g. if the script was run as /some/path/getty-tty1/run, I
> would like to extract "tty1" from the path, or similary, extract "dropbear"
> from /some/path/dropbear-log/run. This would allow to write templated
> services quite easily using symlinks.

The template concept does work, but with limitations. If you don't care
about portability between installations, then it is entirely possible to
use symlinks and a template script. I had tried a project very similar to
your idea, but had to halt progress on it because it did not properly
isolate settings, resulting in a portability problem; it worked for me, but
only in the environment I was running at home. The project is dormant for
the moment, but I will eventually return and re-vamp it away from templates
for portability reasons. Feel free to look around and/or borrow any ideas
from it at https://bitbucket.org/avery_payne/supervision-scripts.
Received on Tue Feb 21 2017 - 18:35:10 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC