sh - POSIX shell module frameworks -


i have happened across shellfire, there other posix module frameworks in use @ moment?

there few bash module systems, see ubuntu forum post.

by way of suggested scheme hand coded modules, placing modules sort of subroutine suffix (_subr, .sub, etc.) in vendor subdir. of lib [edit: on reflection perhaps libdata], reading system directories in relative path:

#!/bin/sh set -e  # exit on error  # boilerplate cd "$(dirname "$0")" . ../share/vendor/install_dir.conf  # includes . "$lib_dir"/vendor/shared_subr  # code... 

'install_dir.conf':

etc_dir=/etc bin_dir=/usr/local/bin sbin_dir=/usr/local/sbin lib_dir=/usr/local/lib libexec_dir=/usr/local/libexec libdata_dir=/usr/local/libdata 

'shared_subr':

test -n "$__shared_subr__" || { __shared_subr__=1  vendor__sub_do_something() {     typeset _local_var _another_local_var      # code...      return 0 }  } 

there lot of reasons use shellfire though.


Comments