not sure if its worth putting it on github,
anyway I tested this one briefly
ks_val_ChkName() {
case "${1:?Missing Variable Name}" in
[!a-zA-Z_]* | *[!a-zA-Z_0-9]* | '' ) return 3;;
esac
}
ks_val_Set() {
ks_val_ChkName "${1}" || return $?
eval "${1}"'="${2}"'
}
ks_cgf_Src() {
local LC_COLLATE=C
local cline_tmp
local vval_tmp
local tmp_quotes="'\""
while IFS= read -r cline_tmp ; do
case "${cline_tmp}" in
\#* | '') ;; # skip empty lines and commented lines
[a-zA-Z_]*=*) # *[![:space:]]*) # non empty lines
vval_tmp=${cline_tmp#*=}
vval_tmp=${vval_tmp#[${tmp_quotes}]}
vval_tmp=${vval_tmp%[${tmp_quotes}]}
ks_val_Set "${cline_tmp%%=*}" "${vval_tmp}" || echo "error '${cline_tmp}'"
#printf "%s=%q\n" "${cline_tmp%%=*}" "${vval_tmp}"
;;
*)echo "skipping '${cline_tmp}'"
;;
esac
done
}
declare | grep "^te"
ks_cgf_Src <<EOF
test=kkkk
te=kll
4te=kll
te4te='kllddf dfs g'
te2te="kllddf dfs g"
EOF
declare | grep "^te"