In a shell script, possibly bash, how can we take many of the same type of argument and add them to an internal array? An example would be like so:
./combine -f file1 -f file2 -f file3 -o output_file
I am aware this simple problem can be solved with cat and redirection alone. But I am interested in how in lets say bash we can take all three of the -f arguments and have them in an array so we can do something with them?
Due to the nature of the requirement we need some form of flags here since there will be other arguments.
In a language like python it is rather easy, especially with library like docopt. You can specify an array as intended and you are done.
Thanks so much