curl_command="curl -s --location 'xxxo?account=$i' --header 'Authorization: Bearer $ast'"
eval $curl_command>account.txt
j=`cat account.txt | grep -E "name" |tail -n 1 |awk -F: '{print $2}'| cut -d '"' -f 2 `
关键是把命令使用eval执行
curl_command="curl -s --location 'xxxo?account=$i' --header 'Authorization: Bearer $ast'"
eval $curl_command>account.txt
j=`cat account.txt | grep -E "name" |tail -n 1 |awk -F: '{print $2}'| cut -d '"' -f 2 `
关键是把命令使用eval执行