📌  相关文章
📜  如何在 shell 脚本中获取数组输入 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:41.881000             🧑  作者: Mango

代码示例1
declare -a array_name
echo "How many groups you want to enter?"
read group_count
echo "enter $group_count groups: "
echo $group_count
for(( c = 0 ; c < $group_count ; c++))
do
  read abc_elements
#  while read abc_elements
#  do
  array_name[$c]="$abc_elements"
#  done
done
echo -e "${array_name[@]}"