Module overview
bash::framehead provides 16 specialized modules totaling ~785 functions. Each module focuses on a specific domain and follows consistent design patterns.Available modules
string
115 functions — Case conversion, padding, splitting, encoding, validation, UUID, base64/32
fs
79 functions — Read/write, paths, find, checksums, temp files, symlinks, permissions
timedate
74 functions — Dates, times, durations, timezones, calendars, stopwatch
terminal
74 functions — Cursor control, screen manipulation, input handling, color detection
colour
65 functions — 4-bit, 8-bit, 24-bit color, ANSI escapes, strip, wrap
math
53 functions — Integer and float arithmetic, trig, stats, unit conversion
process
51 functions — Query, signal, lock, retry, timeout, jobs, services
runtime
50 functions — OS/arch detection, shell flags, environment introspection
array
42 functions — Slice, sort, filter, set operations, zip, chunk, rotate
net
38 functions — IP, DNS, HTTP, interfaces, fetch, ping, port scan
git
35 functions — Branch, commit, status, stash, tags, remotes
hardware
34 functions — CPU, RAM, GPU, disk, battery, partitions
device
25 functions — Block devices, loop, TTY, mount, filesystem
hash
23 functions — MD5, SHA*, HMAC, FNV, DJB2, CRC32, UUID5, slots
random
22 functions — Native, LCG, xorshift, PCG32, xoshiro, ISAAC, WELL512
pm
5 functions — Package manager abstraction (apt/pacman/brew/dnf/…)
Core module: runtime
Theruntime module (331 lines) is the foundation of the entire framework. Every other module depends on it.
Key capabilities
Environment detection:src/runtime.sh:2-5
src/runtime.sh:27-29
You can remove any module except
runtime.sh when compiling a custom build. See compilation for details.String module
The largest module at 933 lines,string provides comprehensive text manipulation.
Function categories
Inspection:src/string.sh:11-13
src/string.sh:27-29
src/string.sh:93-95
::legacy suffix:
src/string.sh:98-100
src/string.sh:50-52
src/string.sh:55-57
Case system matrix
The string module includes 56 conversion functions between 8 naming conventions:| From / To | snake_case | kebab-case | camelCase | PascalCase | CONSTANT | plain text | dot.case | path/case |
|---|---|---|---|---|---|---|---|---|
| snake_case | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| kebab-case | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| camelCase | ✓ | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ |
| PascalCase | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ | ✓ |
| CONSTANT | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ |
| plain text | ✓ | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ |
| dot.case | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | ✓ |
| path/case | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — |
Math module
Themath module (841 lines) handles both integer and floating-point arithmetic.
Integer operations
Pure Bash implementations with no external dependencies:Floating-point operations
Floating-point functions requirebc and check availability:
src/math.sh:37-44
Mathematical constants
The module provides high-precision constants (42 digits):src/math.sh:16-26
Precision for floating-point calculations defaults to 10 decimal places but can be overridden via
MATH_SCALE environment variable.Array module
Thearray module (438 lines) provides functional-style array operations.
Usage pattern
Bash arrays can’t be passed by value, so functions accept elements as$@:
src/array.sh:3-11
Construction utilities
src/array.sh:18-40
Filesystem module
Thefs module (523 lines) handles all file and path operations.
File tests
Clean wrappers around Bash test operators:Path manipulation
Portable path operations without basename/dirname:Hash module
Thehash module (367 lines) provides cryptographic and non-cryptographic hashing.
Available algorithms
Cryptographic:hash::md5— MD5 digesthash::sha1— SHA-1 digesthash::sha256— SHA-256 digesthash::sha512— SHA-512 digesthash::sha3_256— SHA3-256 (requires openssl/python3)hash::blake2b— BLAKE2b (requires openssl/python3)
hash::djb2— DJB2 string hashhash::djb2a— DJB2a varianthash::sdbm— SDBM hashhash::fnv1a32— FNV-1a 32-bithash::fnv1a64— FNV-1a 64-bithash::adler32— Adler-32 checksumhash::crc32— CRC32 checksum
HMAC support
Message authentication codes with OpenSSL:Testing coverage
The framework includes 785 test cases inmain.sh:146-2800:
main.sh:240-247
Module interdependencies
Minimal coupling enables customization:Only
runtime.sh is mandatory. All other modules depend solely on runtime, allowing you to remove any modules you don’t need.Next steps
Architecture
Understand the overall framework design
Compilation
Learn how to build custom distributions
Naming conventions
Master the module::function pattern
API Reference
Browse the complete function reference