Hi,
I have an array of data as below:
df[1] = trx
df[2] = xml
I would like to create a function which contains array inside it and the value is determined when the function is called as below:
function pass_or_fail
{
if [ -s fail/${df[$i]} ]
then
echo " ${df[$i]} FAILED. Please check logs"
elif [ -s pass/${df[$i]} ]
then
echo " ${df[$i]} PASSED."
fi
}
echo "\n Data Loading Summary"
echo " --------------------"
echo "\n trx data loading :"
pass_or_fail 1 ## function calling for $i value = 1
echo "\n xml data loading :"
pass_or_fail 2 ## function calling for $i value = 2
Can anybody check what I am missing here because this looks not working for me
Thanks!