Rechercher une page de manuel
libbash
Langue: en
Version: 362887 (ubuntu - 25/10/10)
Section: 7 (Divers)
BSD mandoc
NAME
libbash - A bash shared libraries package.DESCRIPTION
is a package that enables bash dynamic-like shared libraries. Actually its a tool for managing bash scripts whose functions you may want to load and use in scripts of your own.It contains a `dynamic' loader for the shared libraries ( ldbash(1)Ns),aconfigurationtool(NsXrldbashconfig8Ns),andsomelibraries.
Using ldbash(1)youareabletoloadloadablebashlibraries,suchasXrgetopts1andXrhashstash1Ns. A bash shared library that can be loaded using ldbash(1)mustanswer4requirments:
- It must be installed in Fa $LIBBASH_PREFIX Ns /lib/bash (default is /usr/lib/bash).
- It must contain a line that begins with `#EXPORT=' That line will contain (after the `=' Ns ) a list of functions that the library exports. I.e. all the function that will be usable after loading that library will be listed in that line.
- It must contain a line that begins with `#REQUIRE=' That line will contain (after the `=' Ns ) a list of bash libraries that are required for our library. I.e. every bash library that is in use in our bash library must be listed there.
- The library must be listed (For more information, see ldbashconfig(8)Ns).
Basic guidelines for writing library of your own:
- Be aware, that your library will be actually sourced. So, basically, it should contain (i.e define) only functions.
- Try to declare all variables intended for internal use as local.
- Global variables and functions that are intended for internal use (i.e are not defined in `#EXPORT=' ) should begin with:
__<library_name>_
For example, internal function myfoosort of hashstash library should be named as__hashstash_myfoosort
This helps to avoid conflicts in global name space when using libraries that come from different vendors. - See html manual for full version of this guide.
AUTHORS
An Hai Zaar Aq haizaar@haizaar.com An Gil Ran Aq ril@ran4.netSEE ALSO
ldbash(1), ldbashconfig(8), getopts(1), hashstash(1) colors(1) messages(1) urlcoding(1) locks(1)Contenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre