develog

[mac][bash] array 를 file parameter 로 전달 본문

카테고리 없음

[mac][bash] array 를 file parameter 로 전달

냐옴 2021. 5. 31. 10:50

file1.sh

list=(aa bb cc)
./file2.sh ${list[@]}

file2.sh

for item in $@;
do
    echo ${item}
done

console

$ ./file1.sh
aa
bb
cc

 

Comments