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
Here is another usage :
#!/bin/bash array=( "$@" ) arraylength=${#array[@]} for (( i=0; i<${arraylength}; i++ )); do echo "${array[$i]}" done