I want to build an Errorlog. I would like to build an array as I move through the if statements and print the array once all error conditions have been defined. The results need to be comma delimited.
tsver will be static "1.9.6(2)"
other vars $prit $lt $rt can have the same or a different value as tsver.
For those vars not matching tsver, their values should be written to a csv.
Example errorlog file
This code works, but it seems cheep .... My question is how do I build an array in ksh as I step through the version mismatch tests ?
if [[ "$prit" != "$tsver" ]]
then
echo -n "$prit," >> Errorlog
else
echo -n "," >> Errorlog
fi
#
if [[ "$lt" != "$tsver" ]]
then
echo -n "$lt," >> Errorlog
else
echo -n "," >> Errorlog
fi
#
if [[ "$rt" != "$tsver" ]]
then
echo -n "$rt," >> Errorlog
else
echo -n "," >> Errorlog
fi
Looking through Unix shell by Quigley and searching the web. But havent found anything that gives a good example.
THANKS !!