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 ...

瀏覽:396
日期:2025-11-21
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)) ......看更多