mystring=fifth,forth,third,second,first
IFS=',' read -a ma <<< $mystring
con=""
for i in "${ma[@]}"; do
val=A.$i=B.$i
con="AND $val $con"
done
我想读取数组并构造输出,如下所示,但我收到的错误是在第6行找不到命令。
需要输出:AND A.first = B.first AND A.second = B.second AND ...........