SHTK(1) | General Commands Manual | SHTK(1) |
shtk
— Interface
to the Shell Toolkit
shtk |
build [-m main_function]
[-o output_file]
[-s shell]
[input_file] |
shtk |
version |
The Shell Toolkit, or shtk
for short, is a
collection of modules written in sh(1)
that provide common functionality to simplify the implementation of complex
shell scripts.
The tool described in this page, also named
shtk
, is a program that accompanies the Shell
Toolkit and provides functionality that may be necessary to use the toolkit.
For documentation on the API, please see
shtk(3).
The interface of shtk
is that of a program
with commands as shown in the synopsis section. The following subsections
describe the various commands supported by the tool.
The build command takes a script that uses
shtk
modules and generates an executable script with
the necessary boilerplate code to be able to locate said modules.
The input_file argument specifies the path
to the file to process. This file should end with an ‘.sh’
extension, in which case the build command will proceed to generate a binary
of the same name without any extension. If the extension is not present,
then the name of the output file must be provided by specifying the
-o
flag. The input file can also be
‘-’, in which case the code is read from the standard
input.
The following options are supported:
-m
main_function-m
shtk_unittest_main.
All scripts that use shtk
should
implement a main function and should avoid placing any code at the top
level of the file. The main function is automatically executed by the
generated script. If the value of main_function is
empty, then no call to main is issued which may be necessary if the
script already has a call to main for whatever reason.
Default: ‘main’.
-o
output_fileDefault: 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.
-s
shellDefault: /usr/bin/bash.
The version command prints the name of the package and its version to the standard output. This command always exits successfully.
shtk
modules.The shtk
package was developed by
Julio Merino ⟨jmmv@google.com⟩.
November 8, 2014 | Debian |