I have a function defined below. Each time it runs through the array, I want it to update an existing variable (${1}_FLAG}). Not working as I intended it to. Basically if a new version of said package exist, set the flag to true so I can call another function.
Removed "extra" variables because people are caught up on them. What I need is to update the HTTP_FLAG PHP_FLAG and MOD_QOS variables when they're being looped through.
HTTP_FLAG=false
PHP_FLAG=false
MOD_QOS=false
PKGS=(HTTP PHP MOD_QOS);
check_new_version() {
# If a new version is available, download the source file
if [ ${!check_version} != ${!current_version} ]
then
...
...
${1}_FLAG=true
fi
}
for i in "${PKGS[@]}"
do
check_new_version $i
done
if ${HTTP_FLAG}; then
...
...
fi
HTTP_VER,HTTP_CURRENT,HTTP_LINK, et. al.?HTTP_LINK="http://apache.ziply.com/httpd/${HTTP_VER}"set -vx and set +vxto turn on/off shell debugging trace to see how each cmd/block is being processed with variable substitutions include. Good luck.