How do I convert command-line arguments into a bash script array?
I want to take this:
./something.sh arg1 arg2 arg3
and convert it
Maybe this can help:
myArray=("$@")
also you can iterate over arguments by omitting 'in':
for arg; do echo "$arg" done
will be equivalent
for arg in "${myArray[@]}"; do echo "$arg" done