我想讓我的腳本定義一個空數組。如果預定義條件成立,則應添加數組值。爲此我做了什麼執行這個腳本我得到了一些錯誤,如時是如何操作shell腳本中的數組
declare -a FILES
file_count=0
if [ "$file_ext" != "$SUPPORTED_FILE_TYPE" ] ; then
echo "$file_ext is not supported for this task."
else
$FILES[$file_count] = $filename
file_count=$file_count+1
fi
這
linux-softwares/launchers/join_files.sh: 51: [0]: not found
要進一步閱讀bash數組,請查看http://tldp.org/LDP /abs/html/arrays.html – 2010-02-28 20:32:48