NAME
shellia - library for interactive shell scriptsSYNOPSIS
script.using.shellia [-i|-s|-m]
[ -d debug-runtime-config] [-a] [--]
[script-specific-options]
DESCRIPTION
shellia is a library that allows to run shell scripts interactive and helps to familiarize oneself with large shell scripts, find the cause of unexpected behaviour in shell scripts, and run shell scripts silently, while checking them step by step.OPTIONS
General options
- -i
- use interactive-mode
- -s
- be silent
- -m
- minimal control
- -d debug-runtime-config
- Turn debug-mode on from the beginning. You also may turn debug on and off while running in interactive-mode.
- -a
- Use only ascii without colour in interactive-mode and logging-mode
EXAMPLE
Be aware that the step sizes in the examples listed below are only reasonable to demonstrate shellia features and for no other purpose. Please read shellia(7) NOTES, to learn about a reasonable step size.Basic features
On debian systems the following described script hello_world may be found at /usr/share/doc/shellia/examples/hello_world.$ /usr/share/doc/shellia/examples/hello_world hello world
$ /usr/share/doc/shellia/examples/hello_world -i === hello_world === 1 echo "hello" 2 echo "world" c continue without questionsq quit ? [1]
Interactive-mode
In Basic features all steps shown in Interactive-mode have been at the same level. In Interactive-mode muliple levels are supported.$ /usr/share/doc/shellia/examples/hello_world_fun "Test User" hello Test User
$ /usr/share/doc/shellia/examples/hello_world_fun -i -- "Test User" === hello_world_fun === 1 say_hello -i -- "Test User" i toggle -i flag q quit? [1]
1 say_hello -- "Test User"
=== hello_world_fun/say_hello === 1 name="Test User" 2 echo "hello $name" c continue without questions q quit? [1]
Debug-mode
Each debug-statement in a script-using-shellia has additionally to the debug-output a debug-statement-level, and a debug-statement-topic with the defaults 1 and none.$ /usr/share/doc/shellia/examples/hello_world_debug -d 99 DEBUG main program DEBUG say_hello function start hello world DEBUG say_hello function end
$ /usr/share/doc/shellia/examples/hello_world_debug -d "99 none start" === hello_world_debug === 1 dbg "main program" 2 say_hello_world d ... change dbg: 99 none start c continue without questions q quit ? [1]
? [1] d start 2 === hello_world_debug === 1 dbg "main program" 2 say_hello_world d ... change dbg: 2 none c continue without questions q quit ? [1] c DEBUG main program hello world
Log-mode
If the script-using-shellia creates a logfile as described in shellia(3) logfile-mode, the created logfile has some features as shown in the example script hello_world_log. On debian systems it may be found at /usr/share/doc/shellia/examples/hello_world_log. The example script will automatically display the logfile at the end.$ /usr/share/doc/shellia/examples/hello_world_log "shellia user" hello shellia user --- LOGFILE --- |hello_world_log ||hello_world_log/say_hello ||s:hello shellia user ---------------
$ /usr/share/doc/shellia/examples/hello_world_log -d 99 "shellia user" DEBUG main program begin DEBUG function say_hello called with 1 arguments hello shellia user DEBUG function say_hello end DEBUG main program end --- LOGFILE --- |hello_world_log |DEBUG main program begin ||hello_world_log/say_hello ||DEBUG function say_hello called with 1 arguments ||s:hello shellia user ||DEBUG function say_hello end |DEBUG main program end ---------------
variable in Interactive-mode
If you see $<var> in interactive mode, the meaning is like \${var}, but you can press v to see the actual value of the variable. If you press v again, the name of the variable is shown as before.NOTES
shellia is tested successful with bash, dash, busybox sh, mksh and posh. To use shellia with posh the nounset option ( set -o nounset or set -u) is not supported because of Bug #913718 (posh can not use "$@" together with set -u). Because of Bug #910275 (posh does never execute an "EXIT trap", if it is created with the "trap" command in a sub shell) remaining files named "/tmp/shellia.??????????" should be deleted manual, after using shellia with posh. shellia can not be used in ksh, because the shell does not support the local command.ERROR MESSAGES
ERROR: ia premature exit of command unchecked output: unchecked outputBefore output of a command issued with
check-mode can be printed, it will be collected and checked. If the
script.using.shellia exits premature, the already collected
unchecked output is printed with this error message.
SEE ALSO
shellia(3), shellia(7)AUTHOR
[email protected]COPYRIGHT
Bernd Schumacher <[email protected]> (2007-2020)2020-08-07 | 0.1 |