如何将数组元素传递给unix的find命令?例如。: 我尝试找到tcs / * APPS [i]但是没有工作
APPS=("av_bench" "mpeg4_decoder" "radio_sys" "vopd" "h263e" "h264dl" "sample" "sparse")
for i in APPS
do
DATA=$(find tcs/*APPS[i] -name log_packet_header.csv -exec bash -c 'get_data "{}"' \;)
echo "APPS[i]"
done
由于
答案 0 :(得分:1)
您需要遍历数组的元素。说:
for i in "${APPS[@]}"
do
DATA=$(find tcs/"${i}" -name log_packet_header.csv -exec bash -c 'get_data "{}"' \;)
echo "${i}"
done