SHTK(3)
π SHTK(3) β the shtk Library Functions Manual π
πΈ NAME πΈ
shtk β Application Programming Interface (API) of the Shell Toolkit
π DESCRIPTION π
Okay so the Shell Toolkit, aka shtk for short (iykyk), is a collection of modules written in sh(1) that hand you common functionality so implementing complex shell scripts is, like, actually manageable. This page is your intro to writing scripts with shtk and also the reference for every module it provides. Slay. β¨
π§ Script structure π§
Scripts using shtk follow this structure:
shtk_import module1
shtk_import moduleN
# possibly define globals here
some_custom_function() {
local arg1="${1}"; shift
local arg2="${1}"; shift
# do something
}
main() {
# program entry point; automatically invoked
}
In particular, note: that there is no shebang line at the beginning of the script; that there is no explicit call to main; and that there is no code outside of shell functions other than for calls to shtk_import(3). Periodt. π
π οΈ Script compilation π οΈ
The shtk(1) tool offers a compilation process for scripts using shtk(3). In this context, compilation just refers to the addition of initialization boilerplate code to the script so that the correct modules can be located and that a well-known shell interpreter is used. No cap, that's the whole thing. π
π§© Modules π§©
The shtk_import(3) function depicted above is used to bring the specified modules into the script. For details on all existing modules, see the list of cross-referenced pages in the βSEE ALSOβ section below. π
π SEE ALSO π
π οΈ Built-in functions π οΈ
π§© Modules π§©
shtk_bool(3)shtk_cleanup(3)shtk_cli(3)shtk_config(3)shtk_cvs(3)shtk_fs(3)shtk_hw(3)shtk_list(3)shtk_process(3)shtk_unittest(3)shtk_version(3)
π AUTHORS π
The shtk package was developed by Julio Merino β¨jmmv@google.comβ©.
π Signing off from the Debian edition, February 6, 2017 β mwah, bestie! ππ«Ά
π¦ where this page comes from
- nixos 26.05: shtk 1.7
- nixpkgs unstable: shtk 1.7
- Copyright 2014 Google Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms