File: hello_world_fun

package info (click to toggle)
shellia 5.3.2
  • links: PTS
  • area: main
  • in suites: buster
  • size: 412 kB
  • sloc: sh: 3,235; makefile: 32
file content (28 lines) | stat: -rwxr-xr-x 792 bytes parent folder | download
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_fun
#   copyright: Bernd Schumacher <bernd.schumacher@hpe.com> (2007-2018)
#     license: GNU General Public License, version 3
# description: example "hello world" script with shell function
#     warning: normally it makes
#     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_fun [-i] [--] <name>

. /usr/share/shellia/ia.interactive

# say_hello <name>
say_hello()
{
  local name

  eval "$ia_init"
  ia_add "name=\"$1\""
  ia_add "echo \"hello \$name\""
  ia
}

eval "$ia_init"
ia_add "say_hello <-i> -- \"$1\""
ia