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. However, I noticed there is no substitution nor sed
equivalent in the execline/s6 tool suite ; even a grep-like tool that output
capturing groups would do the trick. I think it would be doable with the
existing set of tools but would be quite heavy.
Does anyone have an idea about this ?