passing an array as command line arguments?
how to pass an array as a command line argument in a shell script?
|
|
The list of arguments is actually an array. It is referenced by "$@" or "$*". For example, suppose you pass six arguments to your script. The number of elements (arguments) is given by "$#" or using the array notation "${#@}". Suppose you want to reference the arguments from the 3th to the 5th:
Code:
echo "${@:3:3}" |
I think the OP wants to pass an existing array as arguments to a command, not get the arguments to his script.
|
Quote:
|
Quote:
I think that an array that's passed as an argument will be interpreted as an array, but there should be a single argument first. Code:
calling_function() http://stackoverflow.com/questions/1...meters-in-bash |
All times are GMT -5. The time now is 06:23 AM. |