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 40
|
#!/bin/sh
# vim: set filetype=sh :
# file: example.wrong-missing-ia_init
# copyright: Bernd Schumacher <bernd.schumacher@hpe.com> (2007-2020)
# license: GNU General Public License, version 3
# description: check if some shellia programming errors are found
# automatically
# see also: test.wrong-missing-ia_init
set -e
set -u
. ./ia
fun2()
{
eval "$ia_init" # err1 if line is missing
ia_add "echo \"function fun2 start\""
ia_add "echo \"function fun2 end\""
#eval "$ia_init" # err2 if line exists
ia
}
fun1()
{
eval "$ia_init" # err3 if line is missing
#eval "$ia_init" # err4 if line exists
ia_add "echo \"function fun1 start\""
ia_add fun2
ia_add "echo \"function fun1 end\""
ia
}
#ia # err5 if line exists
eval "$ia_init" # err6 if line is missing
ia_add "echo \"main p7ogram start\""
#eval "$ia_init" # err7 if line exists
ia_add fun1
ia_add "echo \"main program end\""
ia
|