File: hello_world_debug

package info (click to toggle)
shellia 5.7.6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 728 kB
  • sloc: sh: 7,087; makefile: 34
file content (28 lines) | stat: -rwxr-xr-x 1,169 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/dash
#        file: hello_world_debug
#   copyright: Bernd Schumacher <bernd.schumacher@hpe.com> (2007-2020)
#     license: GNU General Public License, version 3
# description: example "hello world" script with debug
#     warning: Be aware that the interactive step size in this example is only
#              reasonable to summanrized demonstrate shellia features.
#              Read shellia(7) NOTES, to learn about a reasonable size of
#              interactive steps.
#       usage: ./hello_world_debug [-d <debug-runtime-config>] [-i|-s|-m]
#              Used debug-topics in this script are "none", "start" and "end".
#              Highest debug-leves used in this script is 3.
#              See shellia(1) Debug-mode, to learn about <debug-runtime-config>

# we prefer a local copy of ia, if it exists
[ -f ia ] && . ./ia || . /usr/share/shellia/ia

say_hello_world()
{
    dbg 3 start "say_hello function start" # debug-level=3 debug-topic=start
    echo "hello world"
    dbg 3 end "say_hello function end" # debug-level=3 debug-topic=end
}

eval "$ia_init"
ia_add "dbg \"main program\"" # debug-level=1 debug-topic=none
ia_add say_hello_world
ia