Skip to content
Snippets Groups Projects

Generalization

Merged Bianca Wentzel requested to merge generalization into plugin_template
1 file
+ 0
29
Compare changes
  • Side-by-side
  • Inline
+ 0
29
@@ -4,35 +4,6 @@
#
# SPDX-License-Identifier: BSD-3-Clause
check_var_name () {
# check for same variable name from settings and file with 1 variable inside
# $1: var_name from settings
# $2: var_name from file
if [ "$1" != "$2" ]; then
echo "ERROR variable name: $1 $2"
###to-do: exit script with error message exit /b
fi
}
check_var_names () {
# check for same variable name from settings and file with many variable inside
# $1: var_name from settings
# $2...$n: var_names from file, String (HHL HSURF FR_LAND DEPTH_LK FR_LAKE SOILTYP FIELDCAP PORVOL WILPOINT)
local stringarray=(${@:2}) # without first element ($1)
found=false
for i in "${stringarray[@]}"
do
# echo $i
if [ "$i" == "$1" ] ; then
found=true
fi
done
if [ "$found" = "false" ]; then
echo "ERROR variable name: $1 $2"
###to-do: exit script with error message exit /b
fi
}
get_unit () {
# extract the unit of variable
# searching for "....." and cut out without ""
Loading