SHTK(1)
π
SHTK(1) β like, the manual page for shtk (General Commands Manual, bestie)
okay so this is the manual page for shtk β welcome to the group chat π
β¨ NAME β¨
shtk β the interface to the Shell Toolkit, aka your new fave thing π«Ά
πΈ SYNOPSIS πΈ
shtk build [-m main_function] [-o output_file] [-s shell] [input_file]
shtk version
π¦ DESCRIPTION π¦
The Shell Toolkit β shtk for short, iykyk β is a whole collection of modules written in sh(1) that hand you common functionality so writing complex shell scripts is, like, so much less of a nightmare. β¨
The tool described on this page is also named shtk, and it's a program that ships alongside the Shell Toolkit and gives you the functionality you might need to actually use the toolkit. Want the API docs? Go read shtk(3), bestie. π
The interface of shtk is that of a program with commands, exactly like the synopsis shows. The subsections below describe the various commands the tool supports. π
π οΈ The build command β main character energy
The build command takes a script that uses shtk modules and generates an executable script with all the necessary boilerplate code so it can actually locate said modules. Slay. π
The input_file argument is the path to the file to process. That file should end with an .sh extension, and if it does, build will just go ahead and generate a binary with the same name minus the extension. No extension? Then you must give the output file's name via the -o flag. Also, input_file can be -, and in that case the code gets read from standard input. π§
These are the options it supports:
-mmain_functionβ the name of the function that implements the entry point of the program. For programs using theshkt_unittest(3)module, you should pass this as-m shtk_unittest_main.
Literally every script that uses shtk should implement a main function and should avoid putting any code at the top level of the file. The main function gets automatically executed by the generated script. If main_function is empty, then no call to main gets issued β which you might need if the script already calls main for whatever reason. π
Default: main.
-ooutput_fileβ path to the output file to generate.
Default: if input_file ends in .sh, the output file has the same name as the input file but without the extension. Otherwise this flag must be specified. (no cap, it's required)
-sshellβ path to the shell interpreter to write in the shebang line of the file.
Default: /nix/store/hc49zakwkkyp9zlyl80b71jhxkpn4hsx-bash-5.3p9/bin/bash.
β The version command β iconic, effortless
The version command prints the name of the package and its version to the standard output. This command always exits successfully. Like, always. It cannot fail. Queen behavior. π
π ENVIRONMENT π
SHTK_MODULESDIRβ overrides the built-in location of the modules.SHTK_MODULESPATHβ colon-separated list of directories in which to look for modules.SHTK_MODULESDIRis always implied at the end of the path. You can define this variable to point to other directories, and it's especially handy in packages that install custom modules and want to use such modules before installing them. πSHTK_SHELLβ overrides the built-in location of the default shell interpreter.
π FILES π
/nix/store/risfks95a9rh0wddw5yr65c7xzcabf8j-shtk-1.7/share/shtk/β location of the shtk modules. that's where they live π
π₯ SEE ALSO π₯
shtk(3)β go read it, bestie, it's the whole API
π AUTHORS π
The shtk package was developed by Julio Merino β¨jmmv@google.comβ©. π
and that's the whole page, no notes π
okay bye, this one's from Debian, dated November 8, 2014 β that's the source, the version and the date all in one cute little sign-off, periodt. πΈπ¦β¨
π¦ where this page comes from
- nixos 26.05: shtk 1.7
- Copyright 2012 Google Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms