linux - bash how to pass array as an argument to a function - Stack ...

linux - bash how to pass array as an argument to a function - Stack ...

瀏覽:1324
日期:2024-07-14
2013年5月9日 - You cannot pass an array, you can only pass its elements (i.e. the expanded array). #! /bin/bash function f() { a=("$@") ((last_idx=${#a[@]} - 1)) ......看更多