How could I read user input as an array? :)
Here's one way to do it:
If you just run it, it will keep reading from standard-input until you hit Ctrl+D (EOF). Afterwards, the lines you entered will be in
Some interesting pieces of documentation:
And one that doesn't recreate the array each time (though requires bash 3.1 or newer):
See http://mywiki.wooledge.org/BashFAQ/001 for more.
And as always, to avoid writing bugs read http://mywiki.wooledge.org/BashGuide and avoid the tldp-guides like the Advanced bash scripting guide.