📜  将数组传递给 bash 函数 - Shell-Bash 代码示例

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

代码示例1
#!/bin/bash
function copyFiles() {
   arr=("$@")
   for i in "${arr[@]}";
      do
          echo "$i"
      done

}

array=("one 1" "two 2" "three 3")

copyFiles "${array[@]}"