代码片段在这里:
#!/usr/bin/ksh
diff(){
awk 'BEGIN {RS=ORS= }
{NR==FNR?a[$0]++:a[$0]--}
END{for(k in a)if(a[k])print k}' < (echo -n "${!1}") < (echo -n "${!2}")
}
Array1=( key1 key2 key3 key4 key5 key6 key7 key8 key9 key10 )
Array2=( key1 key2 key3 key4 key5 key6 )
Array3=($(diff Array1[@] Array2[@]))
echo ${Array3[@]}
我正面临错误
syntax error at line 6 : `(' unexpected