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 29 30 31 32 33 34 35 36 37 38 39
|
#!/bin/sh
# vim: set filetype=sh :
# file: example.return3
# copyright: Bernd Schumacher <bernd.schumacher@hpe.com> (2007-2020)
# license: GNU General Public License, version 3
# description: If no checking is done, because checking is expected to be done from a subfunction,
# we have to exit if the subroutine is not callable.
# see also: test.return3
. ./ia
fun1()
{
eval "$ia_init"
# the nonzero exit value will bring up interactive menu
ia_nocheck && ia_add "not existing command"
ia_stdout "^"
ia_add "echo \"fun1 end\""
ia -c
}
fun2()
{
eval "$ia_init"
# also the nonzero exit value is ignored with -f option
ia_nocheck -f && ia_add "not existing command"
ia_stdout "^"
ia_add "echo \"fun1 end\""
ia -c
}
eval "$ia_init"
ia_nocheck && ia_add "fun1 <-i>"
ia_nocheck && ia_add "fun2 <-i>"
ia_stdout "^"
ia_add "echo \"main end\""
ia -c
|