Hi,
I am working on bash script after a long time. I am getting error near done statement while running a for loop snippet. The error says "Syntax error near unexpcted token 'done'"
please suggest what could be wrong. here is the snippet
elements=${#option_arr[@]} //an array of values
for((i=0;i<$elements;i++)); do
if [ "${i}" -eq 0 ]; then
BuySell="Buy"
else if [ "${i}" -gt 0 ]; then
if ["$BuySell" -eq "Buy" ]; then
BuySell="Sell"
else
BuySell="Buy"
fi
fi
#str="$ccyPair","$counterParty","${option_arr[${i}]}","$BuySell","$bidPrice","$askPrice","$tradeDate","$expiryDate"
done