'Populate bash array with any amount of arguments
I'm trying to fill an array in my script by passing the content directly to the script:
bash ./script.sh arg1 arg2 arg3
I know that I can address these arguments with $1, $2 and so on but the array doesn't always have the same amount of items in it which is why I can't really do:
databases=($1 $2 $3)
I'd imagine that I could use a loop but I don't know how to loop through all passed arguments.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
