@@ -20,6 +20,19 @@ tested on **Debian**, **FreeBSD**, **macOS**, **Manjaro**, **MinGW**,
2020
2121## Developer Guide
2222
23+ ### Use mulle-bashfunctions in an old bash script
24+
25+ Add this near the top of your script. This will load the default set of
26+ mulle-bashfunctions:
27+
28+
29+ ``` bash
30+ eval " ` mulle-bashfunctions load --if-missing ` "
31+ [ -z " ${MULLE_BASHGLOBAL_SH} " ] && exit 1
32+ ```
33+
34+ ### Create a new mulle-bash script
35+
2336To create a new mulle-bashfunctions script say:
2437
2538``` sh
@@ -29,7 +42,7 @@ chmod +x my-script.sh
2942
3043Use ** mulle-bashfunctions** also for discovery and documentation of the
3144available functions. Lets say you want to produce identifiers
32- for abitrary strings. You can use ` apropos ` to discover functionality:
45+ for arbitrary strings. You can use ` apropos ` to discover functionality:
3346
3447``` sh
3548mulle-bashfunctions apropos identifier
@@ -99,40 +112,47 @@ Use `include "<name>"` to get access to the functions not included in
99112Usage:
100113 mulle-bashfunctions [command]
101114
102- mulle-bashfunctions main purpose is to help load the library functions
103- into an interactive shell. The library functions are almalgamated in a
104- file called "mulle-bashfunctions.sh". There are variants though (none,
105- minimal, all) with different sizes.
106-
107- But mulle-bashfunctions can also
115+ Use mulle-bashfunctions to
108116
117+ * load the mulle-bashfunctions into an interactive shell
118+ * show documentation for the provided shell functions
109119 * embed "mulle-bashfunctions.sh" into another shell script
110120 * show the path to "mulle-bashfunctions.sh"
111121 * locate the "mulle-bashfunctions.sh" install path for a desired variant
112- * show documentation for any of the defined functions
113122 * list the available libraries, which you can "include"
114123 * run an arbitrary mulle-bashfunction with eval and r-eval
124+ * get some information about the execution environment
115125
116- Examples :
117- Load " mulle-bashfunctions-all.sh" into the current interactive shell:
126+ Example :
127+ Load mulle-bashfunctions into the current interactive shell:
118128
119129 eval `mulle-bashfunctions load all`
120130
131+ Now try out an r_function, a function which returns a value in the global
132+ variable RVAL:
133+
134+ r_escaped_json '{ "url": "https://www.mulle-kybernetik.com" }'
135+ echo $RVAL
136+
121137Commands:
122138 apropos <f> : search for a function by keywords
123139 embed : embed mulle-bashfunctions into a script
140+ common-unames : list of known values for uname
124141 env : print environment needed for "mulle-bashfunctions.sh"
125142 eval <cmd> : evaluate cmd inside of mulle-bashfunctions
143+ globals [-a] : list global MULLE_ prefixed variables, -a for all globals
126144 functions : list defined functions
127145 hostname : show system hostname as used by mulle-bashfunctions
128146 libraries : list available libraries
129- load [variant] : use eval `mulle-bashfunctions load` to load
147+ load [variant] : eval `mulle-bashfunctions load <none|minimal|all>`
130148 man <function> : show documention for function, if available
131149 new <name> : prints a mulle-bash shell script
132150 path [variant] : path to "mulle-bashfunctions.sh"
133151 r-eval <cmd> : evaluate cmd inside of mulle-bashfunctions and print RVAL
152+ shell : path of executing shell
134153 username : show username as used by mulle-bashfunctions
135154 uname : show system short name as used by mulle-bashfunctions
155+ uuid : generate a UUID
136156 version : print currently used version
137157 versions : list installed versions
138158
0 commit comments