Hi,

[email protected] wrote on Thu, Mar 10, 2016 at 11:23:14PM +0100:

> Now, let's say I have a library of shell functions, and I want
> the usage instructions and manpage synopsis to be simple:
> 
>   . mylib.sh
>   mylib_this ...
>   mylib_that ...

what you are trying to achieve seems like a terrible idea to me
in the first place, so the answer to your question doesn't matter
all that much.

Do not write libraries of shell functions.  Period.
No non-trivial amount of code should be written for sh(1),
it is one of the most unsafe programming languages by design.
Consider it as a command interpreter for interactive use,
not as a programming language for any non-trivial projects.
Even for private, quick and dirty system administrator style hacks,
you are usually much better off with perl(1) than with sh(1)
security-wise.

For some extremely low-level system code like a boot script (/etc/rc)
or like a command-line system install script, using the shell may
be unavoidable, but even writing such a trivial pieces of software
for the shell needs great care and is better left to experts.

Providing a library of shell functions for other programmers to
play with is a utterly scary idea and very likely to result in lots
of vulnerabilities.  Don't do it.  Not in the 21st century.
Pretty please.

Thanks,
  Ingo

-- 
Ingo Schwarze
http://www.openbsd.org/   <[email protected]>
_______________________________________________
fhs-discuss mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/fhs-discuss

Reply via email to